/* ---------- tokens & reset ---------- */
:root {
  --bg: #08080a;
  --ink: #edece7;
  --dim: #9a9a95;
  --line: #232326;
  --edge: #2c2c30;
  --hover: #17171b;
  --edge-hover: #3d3d43;
  --danger: #e8a39d;
  --danger-edge: #5a2a2a;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --font-sans: ui-sans-serif, -apple-system, "Helvetica Neue", Helvetica, sans-serif;
  --font-display: "Instrument Sans", ui-sans-serif, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--ink);
  font-family: var(--font-mono);
}
a {
  color: var(--ink);
  text-decoration: none;
}
a:hover {
  opacity: 1;
}
input,
select,
button,
textarea {
  font-family: inherit;
}
input::placeholder {
  color: var(--dim);
  opacity: 0.6;
}
button {
  cursor: pointer;
}

/* ---------- animations ---------- */
@keyframes oa-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
[data-a] {
  animation: oa-rise 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-a="1"] {
  animation-delay: 30ms;
}
[data-a="2"] {
  animation-delay: 110ms;
}
[data-a="3"] {
  animation-delay: 190ms;
}
@keyframes oa-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes oa-drawer-in {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes oa-menu-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes oa-menu-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes oa-item-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes oa-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes oa-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes oa-code-a {
  from {
    opacity: 0;
    transform: translateY(0.5em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes oa-code-b {
  from {
    opacity: 0;
    transform: translateY(0.5em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
[data-spin] {
  animation: oa-spin 900ms linear infinite;
}
[data-spin][hidden],
[data-trash-icon][hidden] {
  display: none;
}
[data-cal-refresh-icon].spin {
  animation: oa-spin 900ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  [data-a],
  [data-spin],
  [data-cal-refresh-icon].spin,
  .live-dot {
    animation: none !important;
  }
}

/* ---------- layout shell ---------- */
html:has(body.no-scroll),
body.no-scroll {
  height: 100%;
  overflow: hidden;
}
body.no-scroll .site-shell {
  height: 100vh;
}
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}
.page-main {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.page-main--narrow {
  max-width: 1180px;
  padding: 64px 28px 112px;
}
.page-main--wide {
  max-width: 1240px;
  padding: 60px 28px 112px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.kicker {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.status-line {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}
.section-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.015em;
}
.section-desc {
  margin: 0;
  max-width: 64ch;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 20px;
  width: 100%;
  box-sizing: border-box;
  padding: 22px 28px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.nav-brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  color: inherit;
  opacity: 0.85;
}
.nav-links a:hover {
  opacity: 1;
}
.nav-links a[aria-current="page"] {
  color: var(--ink);
  opacity: 1;
  border-bottom: 1px solid currentColor;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  background: none;
  border: 1px solid currentColor;
  color: var(--ink);
  line-height: 0;
}
.nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  color: var(--ink);
  padding: 0 14px;
  border: 1px solid currentColor;
  background: none;
  font: inherit;
}
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  background: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  line-height: 0;
}
.mobile-menu[hidden] {
  display: none;
}
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: oa-menu-in 180ms ease both;
  font-family: var(--font-sans);
}
.mobile-menu.closing {
  animation: oa-menu-out 240ms cubic-bezier(0.4, 0, 0.6, 1) both;
  pointer-events: none;
}
.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.mobile-menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--dim);
  color: var(--dim);
  line-height: 0;
}
.mobile-menu-close:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.mobile-menu-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 4px 18px 8px;
}
.menu-item {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 18px 2px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.015em;
  animation: oa-item-in 420ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.menu-item--tab {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.menu-item-hint {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
}
.menu-item[aria-current="page"] {
  color: var(--dim);
}
.menu-item[aria-current="page"] .menu-item-hint::after {
  content: " · aktuelle Seite";
}
.menu-section-label {
  display: block;
  margin: 16px 2px 2px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: oa-item-in 420ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.menu-section-label:first-child {
  margin-top: 2px;
}
.mobile-menu-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px 28px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
  animation: oa-item-in 420ms cubic-bezier(0.2, 0.8, 0.25, 1) 320ms both;
}
.mobile-menu-foot a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  opacity: 0.85;
}
.mobile-menu-foot a:hover {
  opacity: 1;
}

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  width: 100%;
  box-sizing: border-box;
  padding: 22px 28px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.footer-links a {
  color: inherit;
  opacity: 0.85;
  border-bottom: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-links a:hover {
  opacity: 1;
}

/* ---------- forms (shared) ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.field-sans {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  font-size: 14px;
}
.input {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 13px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.02em;
  outline: none;
}
.input:focus {
  border-color: var(--ink);
}
.input--select {
  background: var(--bg);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a9a95' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.upload-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 12px 13px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.upload-btn:hover {
  color: var(--ink);
  border-color: var(--edge-hover);
}
.sr-only-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-file:focus-visible + .upload-btn,
.sr-only-file:focus + .upload-btn {
  border-color: var(--ink);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input {
  padding-right: 74px;
}
.field-toggle {
  position: absolute;
  right: 8px;
  padding: 6px 8px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.field-toggle:hover {
  color: var(--ink);
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.check-row:hover {
  color: var(--ink);
}
.check-row input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--ink);
}
.segmented {
  display: flex;
  border: 1px solid var(--edge);
}
.segmented-option {
  position: relative;
  flex: 1;
  display: flex;
}
.segmented-option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.segmented-option span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 13px;
  border-left: 1px solid var(--edge);
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}
.segmented-option:first-child span {
  border-left: none;
}
.segmented-option:hover span {
  color: var(--ink);
}
.segmented-option input:checked + span {
  background: var(--ink);
  color: var(--bg);
}
.segmented-option input:focus-visible + span {
  outline: 1px solid var(--ink);
  outline-offset: -2px;
}
.link-muted {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line);
}
.link-muted:hover {
  color: var(--ink);
  border-color: currentColor;
}
.alert-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--danger-edge);
  background: none;
  color: var(--danger);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 0;
}
.btn-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  opacity: 0.88;
}
.btn-primary[disabled] {
  opacity: 0.6;
  cursor: default;
}
.btn-danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: var(--bg);
}
.btn-danger:hover {
  opacity: 0.88;
}
.btn-danger[disabled] {
  opacity: 0.6;
  cursor: default;
}
.btn-ghost {
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--edge-hover);
}
.btn-ghost--danger {
  color: #e8a39d;
  border-color: #e8a39d;
}
.btn-ghost--danger:hover {
  background: rgba(232, 163, 157, 0.08);
}

/* ---------- login ---------- */
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
.auth-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding: 64px 28px 104px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.auth-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
}
.auth-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.auth-intro p {
  margin: 2px 0 0;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 40px 0 0;
}
.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-foot {
  margin: 28px 0 0;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- error pages ---------- */
.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 96px;
  text-align: center;
}
.error-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
}
.error-code {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 104px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--edge-hover);
}
.error-copy {
  margin: 18px 0 0;
}
.error-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.error-copy p {
  margin: 10px 0 0;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 32px 0 0;
}

/* ---------- dashboard shell ---------- */
.shell-grid {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.side-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-nav-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.side-nav-item {
  text-align: left;
  padding: 14px 16px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
}
.side-nav-item .t {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.side-nav-item .h {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
}
.side-nav-item.active {
  background: var(--hover);
  border-left-color: var(--ink);
  color: var(--ink);
}
.side-nav-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.side-nav-hint {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
}
.content-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tab-panel[hidden] {
  display: none;
}

/* ---------- top tab bar (admin) ---------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  border-bottom: 1px solid var(--line);
}
.admin-tab {
  padding: 0 0 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.admin-tab:hover {
  color: var(--ink);
}
.admin-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- OTP-Sync ---------- */
.sync-wrap {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}
.sync-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sync-list {
  display: flex;
  flex-direction: column;
}
.sync-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.sync-row:last-child {
  border-bottom: 1px solid var(--line);
}
.sync-row[hidden] {
  display: none;
}
.sync-row--top {
  align-items: start;
}
.sync-row--top > .section-label {
  padding-top: 3px;
}
.sys-meter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sys-meter-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  min-width: 0;
}
.sys-meter-value {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.sys-disks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.sys-disks .progress-box {
  padding: 0;
  border: 0;
  gap: 8px;
}
.sync-row .core-grid {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px 18px;
}
.sync-row .core-chip {
  padding: 0;
  border: 0;
}
.sync-row--footer {
  grid-template-columns: minmax(0, 1fr) auto;
}
.sync-row--footer .btn-primary {
  min-width: 160px;
  padding: 11px 18px;
}
.sync-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.sync-inline .input {
  flex: 1;
  min-width: 180px;
}
.sync-inline .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  min-height: 44px;
  font-size: 11px;
}
.sync-inline .input {
  min-height: 44px;
}
.sync-code {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  color: var(--ink);
}
.sync-log {
  display: flex;
  flex-direction: column;
}
.sync-log-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.otpsync-statusbar .status-dot,
.sync-log-row .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
}
.sync-log-row .status-dot {
  grid-row: 1;
  transform: translateY(-1px);
}
.sync-log-text {
  grid-column: 2;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sync-log-when {
  grid-column: 2;
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.btn-ghost--icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.otpsync-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
}
.otpsync-statusbar-sep {
  color: var(--dim);
}
.otpsync-statusbar-error {
  flex-basis: 100%;
  color: #e8a39d;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.otpsync-statusbar-error[hidden] {
  display: none;
}

.collapsible {
  opacity: 1;
}
.collapsible[hidden] {
  display: none;
}
.collapsible-inner {
  min-height: 0;
}

.progress-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--edge);
}
.progress-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.apply-label {
  font-size: 12px;
  letter-spacing: 0.03em;
}
.progress-track {
  height: 3px;
  background: var(--line);
}
.progress-fill {
  height: 3px;
  width: 0%;
  background: var(--ink);
  transition: width 140ms linear;
}
.success-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--edge-hover);
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.core-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--edge);
}
.core-chip-label {
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  width: 14px;
  text-align: right;
  flex-shrink: 0;
}
.core-chip-track {
  flex: 1;
  height: 3px;
  background: var(--line);
  min-width: 0;
}
.core-chip-fill {
  height: 3px;
  width: 0%;
  background: var(--ink);
  transition: width 400ms linear;
}
.core-chip-pct {
  color: var(--dim);
  font-size: 10.5px;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}
.list-row .title {
  font-size: 14px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .meta {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.list-row .play-btn {
  flex-shrink: 0;
}
.list-row.is-highlighted {
  animation: list-row-flash 1.6s ease-out;
}
@keyframes list-row-flash {
  0%,
  40% {
    background: var(--hover);
  }
  100% {
    background: transparent;
  }
}
.add-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.add-btn:hover {
  background: var(--hover);
  border-color: var(--edge-hover);
}
.absence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 12px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  display: inline-block;
}
.legend-swatch.on {
  background: var(--ink);
}
.legend-swatch.off {
  border: 1px solid var(--edge);
}
.legend--clickable {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
.legend--clickable:hover {
  color: var(--ink);
}

/* ---------- calendar ---------- */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-nav .btn-ghost {
  padding: 8px 10px;
}
.cal-btn-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--edge);
}
.cal-btn-group .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.cal-btn-group .btn-ghost:first-child {
  border-right: 1px solid var(--edge);
}
.cal-month-picker {
  position: relative;
}
.cal-month-label {
  min-width: 150px;
  padding: 4px 6px;
  background: none;
  border: 1px solid transparent;
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
}
.cal-month-label:hover,
.cal-month-label[aria-expanded="true"] {
  border-color: var(--edge);
}
.cal-month-menu[hidden] {
  display: none;
}
.cal-month-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--edge);
  animation: oa-fade 120ms ease both;
}
.cal-month-menu .input--select {
  width: auto;
  flex: 0 0 auto;
  padding: 10px 32px 10px 12px;
}
.blade-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 70px 0;
}
.blade-spinner-wrap[hidden] {
  display: none;
}
.blade-spinner-text {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}
.blade-spinner {
  width: 22px;
  height: 22px;
  flex: none;
  background: var(--ink);
  border-radius: 32%;
  animation: squircle-morph 1.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes squircle-morph {
  0% {
    transform: rotate(0deg) scale(0.82);
    border-radius: 30%;
    opacity: 0.55;
  }
  50% {
    transform: rotate(180deg) scale(1);
    border-radius: 46%;
    opacity: 1;
  }
  100% {
    transform: rotate(360deg) scale(0.82);
    border-radius: 30%;
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blade-spinner {
    animation: none;
    opacity: 0.7;
  }
}
.cal-grid-wrap {
  padding: 14px;
  overflow-x: auto;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 560px;
  padding: 0 0 8px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}
.cal-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 560px;
}
.cal-week {
  position: relative;
}
.cal-week-bg {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-day {
  position: relative;
  padding: 8px;
  border: 1px solid var(--edge);
  background: none;
  min-width: 0;
  min-height: max(76px, calc(29px + var(--lanes, 0) * 21px));
}
.cal-day {
  user-select: none;
}
.cal-event-bar.is-pending {
  pointer-events: none;
  background: color-mix(in srgb, var(--dim) 28%, transparent);
  color: var(--ink);
  border: 1px dashed var(--dim);
  padding-top: 1px;
  padding-bottom: 1px;
}
.cal-confirm {
  position: fixed;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--edge-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
}
.cal-confirm::before {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  top: -6px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--bg);
  border-left: 1px solid var(--edge-hover);
  border-top: 1px solid var(--edge-hover);
  transform: rotate(45deg);
}
.cal-confirm.is-above::before {
  top: auto;
  bottom: -6px;
  transform: rotate(225deg);
}
.cal-confirm .btn {
  padding: 8px 12px;
  font-size: 11px;
}
.cal-ctx {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--edge-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
}
.cal-ctx-head {
  padding: 6px 10px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
}
.cal-ctx-empty {
  padding: 6px 10px;
  opacity: 0.6;
}
.cal-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cal-ctx-item:hover,
.cal-ctx-item:focus-visible {
  background: var(--edge-hover);
  outline: none;
}
.cal-day.is-outside {
  opacity: 0.35;
}
.cal-day.is-today {
  border-color: var(--ink);
}
.cal-day-num {
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.cal-day.is-today .cal-day-num {
  color: var(--ink);
}
.cal-today-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  line-height: 0;
  color: #d64545;
}
.cal-week-events {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 18px;
  gap: 3px 4px;
  padding: 26px 0 6px;
  pointer-events: none;
}
.cal-event-bar {
  pointer-events: auto;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cal-event-bar.is-cont-start {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -4px;
  padding-left: 10px;
}
.cal-event-bar.is-cont-end {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -4px;
  padding-right: 10px;
}
.cal-event-bar.is-highlighted {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  animation: cal-event-flash 1.6s ease-out;
}
@keyframes cal-event-flash {
  0%,
  40% {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}
.cal-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.cal-legend-swatch[hidden] {
  display: none;
}
.absence-blob {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-swatch-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.legend-swatch-btn:disabled {
  cursor: default;
}
.legend-swatch-btn .cal-legend-swatch {
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: outline-color 120ms ease;
}
.legend-swatch-btn:not(:disabled):hover .cal-legend-swatch,
.legend-swatch-btn:focus-visible .cal-legend-swatch {
  outline-color: var(--ink);
}

.color-picker-popover {
  position: fixed;
  z-index: 50;
  box-sizing: border-box;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--edge);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: oa-fade 120ms ease both;
}
.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  justify-content: center;
  gap: 6px;
}
.color-picker-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 3px;
  cursor: pointer;
}
.color-picker-swatch:hover {
  border-color: var(--ink);
}
.color-picker-swatch.is-selected {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.rec-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.rec-source-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
/* Both .rec-source-panel and .field set their own `display`, which otherwise
   outranks the browser's default [hidden] rule — this attribute selector
   pins hidden panes closed regardless of which display value they set. */
[data-rec-source-panel][hidden] {
  display: none !important;
}
.rec-hint {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}
#otp-hint {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: -12px;
  transform: translateY(-4px);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    margin-top 220ms ease;
}
#otp-hint.is-visible {
  max-height: 60px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0;
}
.rec-recording-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.play-btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--edge-hover);
  color: var(--ink);
}
.play-btn svg {
  flex-shrink: 0;
}
.icon-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
}
.icon-btn-danger:hover:not(:disabled) {
  color: #e8a39d;
  border-color: #e8a39d;
}
.icon-btn-danger:disabled {
  opacity: 0.5;
}
.rec-search {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
}
.rec-search:focus {
  border-color: var(--dim);
  outline: none;
}

.history-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.history-row .when {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.history-row .what {
  font-size: 13.5px;
}
.history-row .who {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
}

/* ---------- audit log (Verlauf) ---------- */
.audit-log {
  display: flex;
  flex-direction: column;
}
.audit-date {
  padding: 20px 2px 8px 24px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.audit-date:first-child {
  padding-top: 2px;
}
.audit-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 16px;
  padding: 11px 2px 11px 24px;
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
}
.audit-row:last-child {
  border-bottom: none;
}
.audit-row:hover {
  background: var(--hover);
}
.audit-row::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.audit-row:first-child::before {
  top: 50%;
}
.audit-row:last-child::before {
  bottom: 50%;
}
.audit-dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px var(--bg);
  transform: translateY(-50%);
  z-index: 1;
}
.audit-row[data-kind="create"] .audit-dot {
  background: #7fae86;
}
.audit-row[data-kind="update"] .audit-dot {
  background: #d3925f;
}
.audit-row[data-kind="delete"] .audit-dot {
  background: #e8a39d;
}
.audit-time {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding-top: 1px;
}
.audit-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.audit-what {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
}
.audit-who {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 2px 4px;
}
.pagination-row .btn-ghost:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pagination-info {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.calls-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}
.calls-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13px;
}
.calls-table th {
  padding: 8px 10px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
}
.calls-table td {
  padding: 10px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* ---------- recording modal ---------- */
.rec-modal-overlay[hidden] {
  display: none;
}
.rec-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  animation: oa-fade 220ms ease both;
}
.rec-modal-step {
  position: absolute;
  top: 24px;
  left: 24px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.rec-modal-step[hidden] {
  display: none;
}
.rec-modal {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: oa-rise 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.rec-modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex: none;
}
.rec-modal-icon[data-pulse] {
  animation: oa-pulse 1.4s ease-in-out infinite;
}
.rec-modal-icon.is-success {
  border-color: #4f7d58;
  color: #7fae86;
}
.rec-modal-icon.is-warn {
  border-color: #8a5a3d;
  color: #d3925f;
}
.rec-modal-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
}
.rec-modal-text {
  margin: 0;
  max-width: 34ch;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
}
.rec-modal-track {
  width: 100%;
  max-width: 180px;
  height: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 2px;
}
.rec-modal-track[hidden] {
  display: none;
}
.rec-modal-fill {
  height: 100%;
  width: 40%;
  background: var(--ink);
  animation: oa-modal-sweep 1.6s ease-in-out infinite;
}
@keyframes oa-modal-sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}
.rec-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.rec-modal-actions[hidden] {
  display: none;
}
.rec-modal-actions [hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .rec-modal-icon[data-pulse],
  .rec-modal-fill {
    animation: none !important;
  }
}

/* ---------- mic recorder (live visualiser) ---------- */
.mic-panel {
  align-items: center;
  text-align: center;
}
.mic-viz {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 108px;
}
.mic-viz canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0392b;
  display: inline-block;
  flex: none;
}
.mic-dot[data-live] {
  animation: oa-pulse 1.1s ease-in-out infinite;
}

/* ---------- play (spectrum analyzer) modal ---------- */
.play-modal {
  width: min(520px, 100%);
}
.play-modal-viz {
  position: relative;
  width: 100%;
  height: 108px;
}
.play-modal-viz canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.play-modal-timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.play-modal-track {
  flex: 1;
  padding: 9px 0;
  cursor: pointer;
}
.play-modal-time {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 11.5px;
  min-width: 30px;
}
.play-modal-time:last-child {
  text-align: right;
}

/* ---------- drawer / toast ---------- */
.drawer-overlay[hidden] {
  display: none;
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  justify-content: flex-end;
}
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: oa-fade 200ms ease both;
}
.drawer-panel {
  position: relative;
  width: min(500px, 100%);
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-left: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 26px 32px;
  animation: oa-drawer-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.drawer-panel--wide {
  width: min(1200px, 96%);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
}
.drawer-close:hover {
  color: var(--ink);
  border-color: var(--edge-hover);
}
.drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
}
.drawer-title--lg {
  font-size: 24px;
}
.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.section-label {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.divider-top {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.status-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--edge);
  border-left: 2px solid var(--dim);
}
.status-box-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 0;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
  flex: none;
}
.update-warn-icon {
  flex: none;
}
@keyframes oa-spin {
  to {
    transform: rotate(360deg);
  }
}
.status-dot.is-spinning {
  background: none !important;
  border: 1.5px solid var(--edge);
  border-top-color: var(--ink);
  animation: oa-spin 650ms linear infinite;
}
.spinner-ring {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  border: 1.5px solid var(--edge);
  border-top-color: currentColor;
  animation: oa-spin 650ms linear infinite;
}
.log-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.log-row .when {
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.log-row .what {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}

.peruser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.peruser-row .email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
}
.peruser-row .state {
  flex: none;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.peruser-row .state.is-on {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  animation: oa-fade 160ms ease both;
}
.toast[hidden] {
  display: none;
}

/* ---------- admin ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stat-tile {
  background: var(--bg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-tile .label {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.stat-tile .value {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-tile .hint {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}
.toolbar .search-input,
.toolbar .filter-group,
.toolbar .btn-ghost,
.toolbar > .btn {
  height: 44px;
  box-sizing: border-box;
}
.search-input {
  flex: 1;
  min-width: 240px;
  box-sizing: border-box;
  padding: 11px 13px;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
}
.search-input:focus {
  border-color: var(--dim);
  outline: none;
}
.toolbar .btn-ghost,
.toolbar > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filter-group {
  display: flex;
  border: 1px solid var(--line);
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  background: none;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.filter-btn.active {
  background: var(--hover);
  color: var(--ink);
}
/* This toggle sits directly in the drawer's form (a block-level parent), so
   the group stretches to the full form width — without flex:1 the buttons
   only take their content width, leaving an empty gap after the last one. */
[data-absence-mode-group] .filter-btn {
  flex: 1;
  text-align: center;
  padding: 12px 18px;
}
[data-rec-source-group] .filter-btn {
  padding: 12px 18px;
}
.filter-select {
  height: 100%;
  box-sizing: border-box;
  max-width: 150px;
  padding: 0 12px;
  background: none;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
}
.filter-select:focus,
.filter-select:hover {
  color: var(--ink);
  background: var(--hover);
}
select.filter-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%239a9a95' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.filter-select--num {
  width: 92px;
}
.filter-group--fields {
  flex-wrap: nowrap;
}
.filter-group--fields .filter-btn:last-child {
  border-right: none;
}
.table-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 100px 100px 170px 170px 44px;
  gap: 36px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--edge);
}
.table-head span {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 100px 100px 170px 170px 44px;
  align-items: center;
  gap: 36px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.table-row .cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.table-row .name-btn {
  align-self: flex-start;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16.5px;
  letter-spacing: -0.01em;
  text-align: left;
}
.table-row .name-btn:hover {
  text-decoration: underline;
}
.table-row .number {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.table-row .host {
  font-size: 13px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.table-row .mail {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.table-row .status-hint {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
}
.cell-label {
  display: none;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  padding: 5px 0;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.perm-pill.is-on {
  color: var(--ink);
}
.status-pill-link {
  cursor: pointer;
  text-decoration: none;
}
.status-pill-link:hover {
  text-decoration: underline;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.kebab {
  position: relative;
}
.kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
}
.kebab-btn:hover,
.kebab-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--edge-hover);
}
.kebab-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  background: var(--bg);
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  padding: 4px;
  animation: oa-fade 120ms ease both;
}
.kebab-menu[hidden] {
  display: none;
}
.kebab-item-form {
  display: contents;
}
.kebab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-align: left;
}
.kebab-item:hover {
  background: var(--hover);
}
.kebab-item svg {
  flex: none;
  color: var(--dim);
}
.kebab-item:hover svg {
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.count-line {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 14px 2px 0;
}
.empty-line {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 22px 2px;
}
.gen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.save-row .btn-primary {
  flex: 1;
  min-width: 160px;
  padding: 12px 16px;
}
.customer-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-section[hidden] {
  display: none;
}
.form-section--divider {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toggle-pill-row {
  display: flex;
  gap: 8px;
}
.toggle-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
.toggle-pill:hover {
  border-color: var(--edge-hover);
}
.toggle-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.toggle-pill:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.toggle-pill-spinner {
  width: 0;
  height: 9px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0;
  flex: none;
  transition:
    width 160ms ease,
    opacity 160ms ease,
    margin-right 160ms ease;
}
.toggle-pill.is-checking .toggle-pill-spinner {
  width: 9px;
  opacity: 0.8;
  margin-right: 6px;
  animation: toggle-pill-spin 650ms linear infinite;
}
@keyframes toggle-pill-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Geschäftszeiten ---------- */
.hours-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.hours-toolbar-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hours-profile-field {
  flex: 0 1 260px;
  width: 260px;
  max-width: 100%;
}
.hours-profile-field .input--select {
  padding-top: 11px;
  padding-bottom: 11px;
  transition: border-color 120ms ease;
}
.hours-profile-field .input--select:hover:not(:disabled) {
  border-color: var(--edge-hover);
}
.hours-day-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.hours-day-grid[hidden] {
  display: none;
}
.hours-day {
  flex: 1 1 150px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
}
.hours-day-name {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hours-periods {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hours-period-btn {
  align-self: flex-start;
  padding: 7px 10px;
  background: none;
  border: 1px dashed var(--edge);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
}
.hours-period-btn:hover {
  border-color: var(--edge-hover);
  background: var(--hover);
}
.hours-period-btn.is-closed {
  color: var(--dim);
}
.hours-period-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.hours-period-add {
  align-self: flex-start;
  padding: 7px 10px;
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 13px;
}
.hours-period-add:hover {
  color: var(--ink);
}

/* ---------- otp dashboard ---------- */
.otp-toolbar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.otp-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
}
.otp-search-wrap .search-input {
  padding: 12px 64px 12px 13px;
  font-size: 14px;
}
.otp-cmdkey {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.otp-select {
  position: relative;
  min-width: 240px;
}
.otp-select--block {
  width: 100%;
  min-width: 0;
}
.otp-account-select {
  width: 100%;
}
.otp-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.otp-select-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.otp-select-btn[aria-expanded="true"] {
  border-color: var(--ink);
}
.otp-select-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.otp-select-menu[hidden] {
  display: none;
}
.otp-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 45;
  max-height: min(320px, 60vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--edge);
  animation: oa-fade 140ms ease both;
}
.otp-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.otp-select-option:hover {
  background: var(--hover);
}
.otp-select-option.active {
  color: var(--ink);
}
.otp-select-option-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.otp-select-option-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #c0392b;
  display: inline-block;
  flex: none;
}
.otp-select-option-check {
  flex: none;
  opacity: 0;
  color: var(--dim);
}
.otp-select-option.active .otp-select-option-check {
  opacity: 1;
}
.otp-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-sans);
}
.otp-view-btn.active {
  background: var(--hover);
  border-color: var(--edge-hover);
}
@media (max-width: 600px) {
  .otp-search-wrap {
    flex: 1 1 100%;
  }
  .otp-select {
    flex: 1 1 0;
    min-width: 0;
  }
  .otp-cmdkey {
    display: none;
  }
  .otp-select-option {
    padding: 14px 12px;
    font-size: 14px;
  }
}
.otp-panel[hidden] {
  display: none;
}
.otp-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 250px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--edge);
  animation: oa-fade 140ms ease both;
}
.otp-panel-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.otp-panel-label {
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.otp-pill-row {
  display: flex;
  gap: 6px;
}
.otp-pill {
  padding: 7px 11px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.otp-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.otp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
}
.otp-toggle-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: none;
  border: 1px solid var(--edge);
  color: transparent;
  font-size: 11px;
  line-height: 1;
}
.otp-toggle-box.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.otp-grid[data-layout="list"] {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.otp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 22px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  min-width: 0;
}
.otp-card:hover {
  border-color: var(--edge);
}
.otp-grid[data-layout="list"] .otp-card {
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 16px 22px 18px;
}
.otp-grid[data-layout="list"] .otp-card-head {
  flex: 1;
}
.otp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.otp-card-service {
  font-size: 14.5px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.otp-card-account {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
}
[data-hide-mail="true"] .otp-card-account {
  display: none;
}
.otp-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.otp-grid[data-layout="list"] .otp-card-row {
  flex: none;
  justify-content: flex-end;
  gap: 14px;
}
.otp-timer {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  flex: none;
  padding: 6px 0;
  border: 1px solid var(--edge);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.otp-timer.is-low {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.otp-grid[data-layout="list"] .otp-timer {
  display: inline-flex;
}
.otp-code {
  display: inline-block;
  overflow: hidden;
  padding: 0.08em 0;
  font-size: 30px;
  letter-spacing: 0.18em;
  line-height: 1.1;
}
.otp-code span {
  display: inline-block;
}
.otp-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.otp-grid[data-layout="list"] .otp-btns {
  flex-direction: row;
  gap: 14px;
}
.otp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 132px;
  box-sizing: border-box;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--edge);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.otp-btn:hover {
  border-color: var(--edge-hover);
}
.otp-btn.is-copied {
  background: var(--hover);
  border-color: var(--edge-hover);
}
[data-hide-qr="true"] .otp-qr-btn {
  display: none;
}
.otp-bar {
  margin: 4px -22px 0;
  height: 4px;
  background: var(--line);
}
.otp-grid[data-layout="list"] .otp-bar {
  display: none;
}
.otp-bar-fill {
  height: 4px;
  background: var(--ink);
  transition: width 1s linear;
}
.otp-bar-fill.is-low {
  background: var(--dim);
}

.otp-qr-overlay[hidden] {
  display: none;
}
.otp-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: oa-fade 180ms ease both;
}
.otp-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
}
.otp-qr-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 32px 24px;
}
.otp-qr-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: #edece7;
}

@media (max-width: 900px) {
  .otp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .site-nav {
    padding: 16px 14px;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  .nav-brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: inline-flex;
  }
  .nav-actions {
    margin-left: auto;
    gap: 8px;
  }
  .side-nav {
    display: none;
  }
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 20px 18px;
  }
  .footer-links {
    justify-content: center;
    gap: 12px 18px;
  }
}
@media (max-width: 480px) {
  .site-nav {
    padding: 14px 12px;
    font-size: 12.5px;
  }
  .nav-brand {
    font-size: 17px;
  }
  .site-footer {
    padding: 18px 16px;
    font-size: 12.5px;
  }
  .footer-links {
    display: none;
  }
  .auth-intro {
    display: none;
  }
  .absence-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .absence-toolbar .add-btn {
    justify-content: center;
  }
  .list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .list-row-actions {
    flex-wrap: wrap;
  }
  .list-row[data-rec-item] {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .drawer-panel {
    padding: 20px 18px 28px;
    gap: 14px;
  }
  .apply-label {
    font-size: 0;
  }
  .apply-label::before {
    content: "Synchronisierung";
    font-size: 12px;
    letter-spacing: 0.03em;
  }
}
@media (max-width: 900px) {
  .auth-pane {
    padding: 48px 18px 72px;
  }
  .page-main--narrow {
    padding: 40px 16px 80px;
  }
  .shell-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .side-nav {
    position: static;
  }
  .side-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rec-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .rec-mic-label {
    font-size: 0;
  }
  .rec-mic-label::before {
    content: "Handy-Mikrofon";
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .cal-toolbar .section-heading {
    display: none;
  }
  .cal-grid-wrap {
    padding: 8px 4px;
    overflow-x: visible;
  }
  .cal-weekdays {
    min-width: 0;
    gap: 2px;
    font-size: 9px;
    letter-spacing: 0.04em;
  }
  .cal-grid {
    min-width: 0;
    gap: 2px;
  }
  .cal-week-bg {
    gap: 2px;
  }
  .cal-day {
    padding: 3px;
    min-height: max(50px, calc(17px + var(--lanes, 0) * 15px));
  }
  .cal-day-num {
    font-size: 9.5px;
  }
  .cal-today-icon {
    top: 4px;
    right: 4px;
  }
  .cal-today-icon svg {
    width: 5px;
    height: 5px;
  }
  .cal-week-events {
    grid-auto-rows: 13px;
    gap: 2px;
    padding: 16px 0 3px;
  }
  .cal-event-bar {
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 8px;
  }
  .cal-event-bar.is-cont-start {
    margin-left: -3px;
    padding-left: 6px;
  }
  .cal-event-bar.is-cont-end {
    margin-right: -3px;
    padding-right: 6px;
  }
  .cal-month-label {
    min-width: 0;
    font-size: 14px;
  }
  .cal-toolbar {
    gap: 10px;
  }
  .cal-nav {
    gap: 8px;
  }
  .hours-toolbar {
    align-items: stretch;
    padding-bottom: 16px;
  }
  .hours-profile-field {
    width: 100%;
    flex: 1 1 auto;
  }
}
@media (max-width: 1000px) {
  .page-main--wide {
    padding: 40px 16px 80px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-head {
    display: none;
  }
  .table-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .row-actions {
    justify-content: flex-start;
  }
  .cell-label {
    display: block;
  }
  .field-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .sync-row,
  .sync-row--footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

/* ---------- Telefonanlagen: row selection + floating bulk action bar ---------- */
.check-col {
  width: 28px;
  padding-right: 0 !important;
}
.row-check {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  display: block;
  background: none;
  border: 1px solid var(--edge-hover);
  border-radius: 0;
  cursor: pointer;
  position: relative;
}
.row-check:hover {
  border-color: var(--dim);
}
.row-check:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.row-check:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.row-check:indeterminate {
  background: var(--ink);
  border-color: var(--ink);
}
.row-check:indeterminate::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 7px;
  height: 1.5px;
  background: var(--bg);
}
[data-system-row].is-selected td {
  background: var(--hover);
}
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--edge-hover);
  animation: oa-fade 240ms ease both;
  max-width: calc(100vw - 32px);
}
.bulk-bar[hidden] {
  display: none;
}
.bulk-count {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 6px;
}
.bulk-count strong {
  color: var(--ink);
  font-weight: 500;
}
.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 11px;
  white-space: nowrap;
}
.bulk-btn[disabled] {
  opacity: 0.5;
  cursor: progress;
}
.bulk-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: none;
  color: var(--dim);
}
.bulk-clear:hover {
  color: var(--ink);
}
@media (max-width: 640px) {
  .bulk-bar {
    flex-wrap: wrap;
    justify-content: center;
    bottom: 14px;
  }
}

/* ---------- Backups drawer ---------- */
.bk-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  padding: 11px 18px;
}
.bk-create[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.bk-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 18px 0;
}
.bk-loading[hidden] {
  display: none;
}
.bk-list {
  display: flex;
  flex-direction: column;
}
.bk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bk-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 13.5px;
}
.bk-sub {
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 12px;
}
.bk-sub.is-error {
  color: var(--danger);
}
.bk-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bk-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--edge);
  color: var(--ink);
}
.bk-dl:hover {
  border-color: var(--edge-hover);
  background: var(--hover);
}
.bk-pbx {
  border-top: 1px solid var(--edge);
  margin-top: 8px;
}
.bk-pbx summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.bk-pbx summary::-webkit-details-marker {
  display: none;
}
.bk-pbx[open] summary {
  color: var(--ink);
}
.bk-pbx .bk-row {
  padding: 9px 0;
}
.bk-pbx .bk-name {
  font-size: 12.5px;
}
.bk-count {
  font-family: var(--font-sans);
  letter-spacing: 0;
}

/* ---------- Phones drawer ---------- */
.drawer-panel--phones {
  width: min(1400px, 96%);
}
.phones-count {
  color: var(--dim);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0;
}
.phones-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 13px;
  white-space: nowrap;
  vertical-align: middle;
}
.phones-table tbody tr:hover {
  background: var(--hover);
}
.phones-ext {
  font-variant-numeric: tabular-nums;
}
.phones-sub {
  color: var(--dim);
  font-size: 11.5px;
  margin-top: 2px;
}
.phones-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.phones-up {
  margin-left: 8px;
  color: #d8bd87;
  font-size: 11px;
}
.copy-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: 1px solid var(--edge);
  color: var(--dim);
}
.copy-btn:hover {
  color: var(--ink);
  border-color: var(--edge-hover);
}

.bulk-btn[disabled]:has(.bulk-progress) {
  opacity: 1;
}
.bulk-progress {
  display: block;
  flex: 1;
  height: 3px;
  min-width: 60px;
  background: var(--edge);
  overflow: hidden;
}
.bulk-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 200ms linear;
}

/* ---------- Admin: System tab ---------- */
.sys-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.sys-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.sys-card,
.sys-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--edge);
  min-width: 0;
}
.sys-card[hidden] {
  display: none;
}
.sys-card-value {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.sys-card-value--sm {
  font-size: 20px;
  padding: 6px 0 5px;
}
.sys-card .progress-track {
  margin-top: auto;
}
.sys-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.sys-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.sys-chart {
  display: block;
  width: 100%;
  height: 120px;
  overflow: visible;
}
.sys-chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.sys-chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.sys-chart-area {
  fill: var(--ink);
  opacity: 0.08;
  stroke: none;
}
.sys-panel .core-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px 18px;
}
.sys-panel .core-chip {
  padding: 0;
  border: 0;
}
.sys-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sys-range .rec-hint { margin-left: auto; }
.sys-legend { display: inline-flex; gap: 12px; align-items: baseline; }
.sys-key { font-size: 12px; color: var(--dim); }
.sys-key::before { content: ""; display: inline-block; width: 10px; height: 2px; background: var(--ink); margin-right: 5px; vertical-align: middle; }
.sys-key--b::before { background: var(--dim); }
.sys-chart-line--b { stroke: var(--dim); stroke-dasharray: 4 3; }
.sys-chart-line--b:not([d]), .sys-chart-line--b[d=""] { display: none; }
.sys-procs { display: flex; flex-direction: column; gap: 6px; }
.sys-proc { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sys-proc span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-proc span:last-child { color: var(--dim); font-variant-numeric: tabular-nums; flex: none; }
.sys-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.sys-facts dt { color: var(--dim); }
.sys-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .sys-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Admin: Kunde anlegen – Ladezustand ---------- */
.customer-form { position: relative; }
.form-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg, #fff) 88%, transparent);
  backdrop-filter: blur(2px);
}
.form-loading[hidden] { display: none; }
.form-loading-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  padding: 18px;
  border: 1px solid var(--edge);
  background: var(--bg, #fff);
}
.form-loading-text { font-size: 14px; color: var(--ink); }
.form-loading-sub { font-size: 12px; color: var(--ink-dim, var(--ink)); opacity: 0.7; }
.form-loading-track { position: relative; overflow: hidden; }
.form-loading-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: var(--ink);
  animation: form-loading-slide 1.2s ease-in-out infinite;
}
@keyframes form-loading-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ---------- problem marquee (admin) ---------- */
.problem-bar {
  display: flex;
  align-items: stretch;
  margin: -16px 0 -16px;
  border: 1px solid var(--edge);
  overflow: hidden;
}
.problem-bar-label {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid var(--edge);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.problem-bar-view {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 10px 0;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.problem-bar-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
}
.problem-bar-track.is-scrolling {
  animation: problem-marquee var(--marquee-dur, 30s) linear infinite;
}
.problem-bar-view:hover .problem-bar-track.is-scrolling {
  animation-play-state: paused;
}
.problem-bar-track.is-static {
  padding-left: 16px;
}
.problem-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 36px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.problem-item .status-dot {
  background: var(--dot, #e8a39d);
}
@keyframes problem-marquee {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .problem-bar-track.is-scrolling {
    animation: none;
  }
}
