/* bit.PASS „Schluesselbund" — Tokens und Bausteine aus docs/design/schluesselbund.html.
   Aenderungen am Design gehoeren zuerst dorthin, dann hierher. Schriften: fonts.css (self-hosted). */

:root {
  color-scheme: light;
  --ground: #f7f9fa;
  --paper: #ffffff;
  --raised: #f3f6f9;
  --sunken: #e6e9ef;
  --ink: #1b2029;
  --ink-muted: #606d91;
  --ink-faint: #a8b3c8;
  --leaf: #175cdb;
  --leaf-deep: #0d3c77;
  --leaf-soft: #dbe5f6;
  --leaf-ring: #9dbaea;
  --ok: #0c8018;
  --ok-soft: #d5f3d8;
  --honey: #8e4000;
  --honey-soft: #fff4d4;
  --clay: #cb263a;
  --clay-soft: #ffecef;
  --on-leaf: #ffffff;
  --shadow: 0 1px 2px rgb(30 42 37 / 0.06), 0 8px 24px -12px rgb(30 42 37 / 0.18);
  --frame: #d9ddd3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ground: #020618;
    --paper: #202733;
    --raised: #303946;
    --sunken: #121a27;
    --ink: #f3f6f9;
    --ink-muted: #8898b5;
    --ink-faint: #525b6a;
    --leaf: #65abff;
    --leaf-deep: #aac3ef;
    --leaf-soft: #1d2e63;
    --leaf-ring: #1a41ac;
    --ok: #6bf178;
    --ok-soft: #08510f;
    --honey: #ffbf00;
    --honey-soft: #8e4000;
    --clay: #ff4e63;
    --clay-soft: #951b2a;
    --on-leaf: #101613;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.5);
    --frame: #2c3630;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --ground: #020618;
  --paper: #202733;
  --raised: #303946;
  --sunken: #121a27;
  --ink: #f3f6f9;
  --ink-muted: #8898b5;
  --ink-faint: #525b6a;
  --leaf: #65abff;
  --leaf-deep: #aac3ef;
  --leaf-soft: #1d2e63;
  --leaf-ring: #1a41ac;
  --ok: #6bf178;
  --ok-soft: #08510f;
  --honey: #ffbf00;
  --honey-soft: #8e4000;
  --clay: #ff4e63;
  --clay-soft: #951b2a;
  --on-leaf: #101613;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.5);
  --frame: #2c3630;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font:
    400 16px/1.55 'Alegreya Sans',
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.display {
  font-family: Alegreya, Georgia, 'Times New Roman', serif;
  font-weight: 500;
  letter-spacing: 0;
}
p {
  margin: 0;
}
a {
  color: var(--leaf);
}
:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 6px;
}
.mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}
[hidden] {
  display: none !important;
}

/* ── Bausteine ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--leaf);
  color: var(--on-leaf);
  text-decoration: none;
}
.btn:hover {
  background: var(--leaf-deep);
}
.btn.quiet {
  background: var(--raised);
  color: var(--ink);
}
.btn.quiet:hover {
  background: var(--sunken);
}
.btn.clay {
  background: var(--clay-soft);
  color: var(--clay);
}
.btn.clay:hover {
  background: var(--clay);
  color: var(--paper);
}
.btn .key {
  width: 8px;
  height: 19px;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
/* „In Ordnung" ist Gruen, nicht die Markenfarbe: Blau ist bei Bitwarden die primaere
   Aktion — ein blauer Erfolgs-Pill laese sich als Hinweis, nicht als Haken. */
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.wait {
  background: var(--honey-soft);
  color: var(--honey);
}
.pill.off {
  background: var(--raised);
  color: var(--ink-muted);
}
.pill.off::before {
  background: var(--ink-faint);
}
.hint {
  color: var(--ink-muted);
  font-size: 13.5px;
}
.honey {
  color: var(--honey);
  font-weight: 700;
}

/* Schluessel-Symbol */
.key {
  width: 11px;
  height: 26px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .ring {
  width: 22px;
  height: 52px;
  color: var(--leaf);
}
.brand h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand p {
  color: var(--ink-muted);
  font-size: 14.5px;
  font-weight: 400;
  font-family: Alegreya, Georgia, serif;
  font-style: italic;
}
.brand.small .ring {
  width: 15px;
  height: 36px;
}
.brand.small h1 {
  font-size: 17px;
}

/* ── Anmelden / Karte ─────────────────────────────── */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}
.login-card {
  width: min(100%, 440px);
  background: var(--paper);
  border-radius: 16px;
  padding: 36px 32px 28px;
  display: grid;
  gap: 22px;
  box-shadow: var(--shadow);
}
.tenants {
  display: grid;
  gap: 8px;
}
.tenant {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 12px;
  border-radius: 14px;
  background: var(--raised);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 0 1px transparent;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.tenant:hover,
.tenant:focus-visible {
  background: var(--leaf-soft);
  box-shadow: 0 0 0 1px var(--leaf-ring);
  transform: translateY(-1px);
}
/* Firmenschild: die Kundenmarken sind fuer weissen Grund gezeichnet und unterschiedlich
   breit — ein eigenes weisses Feld gibt ihnen Halt und haelt die Zeilen gleich hoch. */
.tenant-logo {
  display: block;
  width: 104px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 7px 9px;
  box-shadow: 0 1px 2px rgb(30 42 37 / 0.07);
}
.tenant .key {
  width: 104px;
  height: 56px;
  padding: 8px;
  color: var(--leaf);
}
.tenant-name {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-weight: 700;
  line-height: 1.25;
}
/* Domain gehoert unter den Namen, nicht an den rechten Rand — die generische
   .tenant small-Regel wuerde sie dorthin schieben. */
.tenant-name small {
  margin: 0;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink-faint);
}
@media (max-width: 460px) {
  .tenant {
    gap: 12px;
    padding: 10px 12px 10px 10px;
  }
  .tenant-logo,
  .tenant .key {
    width: 80px;
    height: 46px;
  }
  .tenant-name {
    font-size: 15px;
  }
}
.login-foot {
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}

/* ── Hinweis / Fehler ─────────────────────────────── */
.notice {
  display: grid;
  gap: 10px;
}
.notice h2 {
  font-family: Alegreya, Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
}
.notice p {
  color: var(--ink-muted);
}
.notice.clay h2,
.notice.clay .key {
  color: var(--clay);
}
.notice .lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.notice .lead .key {
  margin-top: 4px;
}
.notice .btn {
  justify-self: start;
}
.notice .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Einrichten ───────────────────────────────────── */
.onb {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}
.onb-rail {
  background: var(--raised);
  padding: 32px 24px;
  display: grid;
  align-content: start;
  gap: 28px;
}
.ring-steps {
  display: grid;
  gap: 4px;
}
.ring-steps .step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 14px;
  text-decoration: none;
}
.ring-steps .step .key {
  color: var(--ink-faint);
}
.ring-steps .step.done {
  color: var(--ink);
}
.ring-steps .step.done .key {
  color: var(--leaf);
}
.ring-steps .step.now {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.ring-steps .step.now .key {
  color: var(--honey);
}
.ring-steps .step.now.done .key {
  color: var(--leaf);
}
.rail-ring {
  display: grid;
  place-items: center;
}
.rail-ring svg {
  width: 170px;
  height: 170px;
}
.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-faint);
  word-break: break-all;
}
.rail-foot a {
  color: var(--ink-muted);
}
.onb-body {
  padding: 44px 48px;
  display: grid;
  align-content: start;
  gap: 26px;
  max-width: 640px;
}
.onb-body .eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--leaf);
}
.onb-body h2 {
  font-family: Alegreya, Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
}
.onb-body .lede {
  font-size: 16.5px;
  color: var(--ink-muted);
}
.onb-body ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}
.onb-body ol li::marker {
  color: var(--leaf);
  font-weight: 700;
}
.onb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.onb-actions .hint {
  margin-left: auto;
}
.aside {
  background: var(--leaf-soft);
  color: var(--leaf-deep);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.aside .key {
  color: var(--leaf);
  margin-top: 2px;
}
.aside.honey {
  background: var(--honey-soft);
  color: var(--honey);
  font-weight: 400;
}
.aside.honey .key {
  color: var(--honey);
}
.aside.clay {
  background: var(--clay-soft);
  color: var(--clay);
}
.aside.clay .key {
  color: var(--clay);
}
.aside:empty {
  display: none;
}
.copy {
  display: grid;
  gap: 6px;
}
.copy label {
  font-weight: 700;
  font-size: 14px;
}
.copy .row {
  display: flex;
  gap: 8px;
}
.copy input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 0;
  background: var(--raised);
  color: var(--ink);
}
.copy input:focus {
  outline: 2px solid var(--leaf);
  background: var(--paper);
}
.stores {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Admin ────────────────────────────────────────── */
.admin {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}
.side {
  background: var(--raised);
  padding: 24px 16px;
  display: grid;
  align-content: start;
  gap: 24px;
}
.side .brand h1 {
  font-size: 17px;
}
.side .brand .ring {
  width: 15px;
  height: 36px;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.nav a.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.nav small {
  display: block;
  padding: 14px 12px 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.side-foot {
  margin-top: auto;
  padding: 0 12px;
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-faint);
  word-break: break-all;
}
.side-foot a {
  color: var(--ink-muted);
}
.main {
  padding: 28px 32px 36px;
  display: grid;
  align-content: start;
  gap: 22px;
  min-width: 0;
}
.main > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.main > header h2 {
  font-family: Alegreya, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}
.main > header p {
  color: var(--ink-muted);
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  background: var(--raised);
  border-radius: 14px;
  padding: 16px 18px;
  display: grid;
  gap: 4px;
}
.stat b {
  font-family: Alegreya, Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}
.stat span {
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
}
.stat.warn b {
  color: var(--honey);
}
.personen {
  display: grid;
  gap: 14px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--raised);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.chip:hover {
  background: var(--sunken);
}
.chip.on {
  background: var(--leaf-soft);
  color: var(--leaf-deep);
}
.filters .search {
  margin-left: auto;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 0;
  background: var(--raised);
  color: var(--ink);
  width: 220px;
}
.filters .search:focus {
  outline: 2px solid var(--leaf);
  background: var(--paper);
}
.tablewrap {
  overflow-x: auto;
  border-radius: 14px;
  background: var(--paper);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  padding: 12px 16px 8px;
}
td {
  padding: 12px 16px;
  vertical-align: middle;
}
tbody tr:nth-child(odd) td {
  /* --sunken, nicht --ground: der Seitengrund ist im Dunkelmodus fast schwarz und
     damit dunkler als die Karte — Zebrastreifen wirkten wie Loecher. */
  background: var(--sunken);
}
tbody tr:first-child td:first-child {
  border-top-left-radius: 10px;
}
tbody tr:first-child td:last-child {
  border-top-right-radius: 10px;
}
td.name {
  font-weight: 700;
}
td .sub {
  display: block;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 400;
}
td.muted {
  color: var(--ink-muted);
}
td.act {
  text-align: right;
  white-space: nowrap;
}
td.empty {
  color: var(--ink-muted);
  text-align: center;
  padding: 28px 16px;
}
.kebab {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.kebab::-webkit-details-marker {
  display: none;
}
.kebab:hover,
.menu[open] .kebab {
  background: var(--raised);
  color: var(--ink);
}
.menu {
  position: relative;
  display: inline-block;
}
.menu-list {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 2;
  min-width: 190px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  text-align: left;
}
.menu-list button {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--clay);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-list button:hover {
  background: var(--clay-soft);
}
.log {
  display: grid;
  gap: 10px;
}
.log h3 {
  font-size: 15px;
}
.log pre {
  margin: 0;
  background: var(--sunken);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--ink-muted);
  overflow-x: auto;
  line-height: 1.7;
}
.log pre b {
  color: var(--ink);
  font-weight: 500;
}
.log pre .t {
  color: var(--ink-faint);
}
.log pre .w {
  color: var(--honey);
}
.log pre .c {
  color: var(--clay);
}
.log .more {
  font-size: 13.5px;
}

/* ── Dialog: nur hier Ton ─────────────────────────── */
dialog.dialog {
  border: 0;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: min(100% - 32px, 460px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog.dialog::backdrop {
  background: rgb(30 42 37 / 0.35);
}
dialog.dialog form {
  display: grid;
  gap: 14px;
}
dialog.dialog h3 {
  font-size: 24px;
  color: var(--clay);
  display: flex;
  gap: 10px;
  align-items: center;
}
dialog.dialog h3 .key {
  color: var(--clay);
}
dialog.dialog p {
  color: var(--ink-muted);
}
dialog.dialog .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Schluessel am Samenring */
.tone-leaf {
  color: var(--leaf);
}
.tone-honey {
  color: var(--honey);
}
.tone-faint {
  color: var(--ink-faint);
}

/* htmx */
.htmx-request .btn {
  opacity: 0.7;
}

@media (max-width: 760px) {
  .onb,
  .admin {
    grid-template-columns: 1fr;
  }
  .onb-rail,
  .side {
    padding: 20px;
    gap: 16px;
  }
  .rail-ring,
  .rail-foot,
  .side-foot {
    display: none;
  }
  .onb-body,
  .main {
    padding: 24px 20px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .filters .search {
    margin-left: 0;
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
