/* =========================================================================
   M-Share – Design-System
   Eine Datei für alle Seiten. Farben/Abstände als Tokens, darunter
   Layout (App-Shell), Komponenten und Hilfsklassen.
   ========================================================================= */

@font-face { font-family: 'Atkinson Next'; font-weight: 400; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Atkinson Next'; font-weight: 500; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Atkinson Next'; font-weight: 600; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Atkinson Next'; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Atkinson Next'; font-weight: 800; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Atkinson Next'; font-weight: 400; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Mono'; font-weight: 500; font-display: swap; src: url('/fonts/atkinson-hyperlegible-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Mono'; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-mono-latin-700-normal.woff2') format('woff2'); }

:root {
  /* Grundfarben */
  --ink: #16324f;          /* Text, Seitenleiste */
  --ink-2: #2b4866;
  --paper: #f3f5f4;        /* App-Hintergrund */
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #dde3e1;
  --line-strong: #c5cfcc;
  --muted: #5b6b7a;
  --faint: #8795a1;

  /* Schulfarbe (wird pro Schule per JS gesetzt) */
  --brand: #005ea8;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --brand-hover: color-mix(in srgb, var(--brand) 85%, black);

  /* Status */
  --ok: #1f8a5b;      --ok-soft: #e3f3eb;
  --warn: #a86400;    --warn-soft: #fbefd9;
  --bad: #c2372f;     --bad-soft: #fbe4e2;
  --plan: #4f49c2;    --plan-soft: #e9e8fb;

  /* Etikett (Inventar-Code) */
  --tag: #fff6d6;
  --tag-line: #e8d48a;
  --tag-ink: #5a4a12;

  /* Typografie */
  --font: 'Atkinson Next', 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;

  /* Form */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-pop: 0 12px 32px -8px rgba(22, 50, 79, 0.28), 0 2px 6px rgba(22, 50, 79, 0.08);
  --sidebar-w: 256px;
  --topbar-h: 56px;
  --bottomnav-h: 64px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }

.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  flex-shrink: 0;
  user-select: none;
}
.icon.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.icon.sm { font-size: 18px; }
.icon.lg { font-size: 28px; }

/* =========================================================================
   App-Shell
   ========================================================================= */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: #d7e1ea;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  color: #fff;
  text-decoration: none !important;
}
.sidebar-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--r);
  padding: 4px;
}
.sidebar-brand .school {
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.25;
}
.sidebar-brand .product {
  font-size: var(--fs-xs);
  color: #9fb3c6;
}

.nav { padding: 4px 12px 12px; flex: 1; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title {
  font-size: var(--fs-xs);
  color: #8ea3b8;
  padding: 0 12px 6px;
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: #d7e1ea;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}
.nav a .icon { font-size: 20px; color: #9fb3c6; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a:hover .icon { color: #fff; }
.nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav a[aria-current='page'] .icon { color: #fff; font-variation-settings: 'FILL' 1; }
.nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-on-dark, #6cb6ff);
}
.nav .pill {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--warn-soft);
  color: var(--warn);
  padding: 1px 8px;
  border-radius: 999px;
}

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 12px 16px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f5379;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.user-chip .name { color: #fff; font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; }
.user-chip .sub { color: #9fb3c6; font-size: var(--fs-xs); }
.sidebar-user a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c3d1de;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.sidebar-user a .icon { font-size: 18px; }
.sidebar-user a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content {
  width: 100%;
  max-width: 1200px;
  padding: 32px 40px 56px;
}

/* Topbar + Bottom-Navigation nur mobil */
.topbar, .bottomnav, .drawer-backdrop { display: none; }

@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-pop);
  }
  .app.drawer-open .sidebar { transform: none; }
  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(13, 30, 48, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 35;
  }
  .app.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    padding: 0 8px 0 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .topbar .school-name {
    font-weight: 700;
    font-size: var(--fs-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
  .topbar img { width: 30px; height: 30px; object-fit: contain; }
  .content { padding: 24px 24px 48px; }
}

@media (max-width: 719px) {
  .content { padding: 18px 16px calc(var(--bottomnav-h) + 32px + env(safe-area-inset-bottom)); }
  .bottomnav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bottomnav a, .bottomnav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
  }
  .bottomnav a[aria-current='page'] { color: var(--brand); }
  .bottomnav a[aria-current='page'] .icon { font-variation-settings: 'FILL' 1; }
  .bottomnav .scan-btn .icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 28px;
    box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--brand) 60%, transparent);
    border: 4px solid var(--surface);
  }
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: inherit;
}
.icon-btn:hover { background: rgba(22, 50, 79, 0.06); }

/* =========================================================================
   Seitenkopf
   ========================================================================= */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; }
.page-head .lead { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 10px;
}
.back-link .icon { font-size: 18px; }

@media (max-width: 719px) {
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head h1 { font-size: var(--fs-lg); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}

/* =========================================================================
   Flächen
   ========================================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: var(--fs-md); }
.panel-head .sub { color: var(--muted); font-size: var(--fs-sm); }
.panel-body { padding: 20px; }
.panel-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1023px) {
  .grid-2, .grid-main-side { grid-template-columns: 1fr; }
}
.stack > * + * { margin-top: 20px; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --h: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-base);
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn .icon { font-size: 20px; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, white); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(22, 50, 79, 0.06); border-color: transparent; }
.btn-sm { --h: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-sm .icon { font-size: 18px; }
.btn-lg { --h: 50px; padding: 0 22px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Formulare
   ========================================================================= */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 719px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink);
}
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-xs); color: var(--bad); }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 16px; /* verhindert Zoom auf iOS/Android */
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid='true'] { border-color: var(--bad); }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%235b6b7a'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.textarea { min-height: 140px; resize: vertical; }
.input.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
  font-size: 20px;
}
.input-icon .input { padding-left: 42px; }

.datetime { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

/* Auswahl-Chips (z.B. Zustand, schnelle Zeiträume) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.chip .icon { font-size: 18px; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.ok[aria-pressed='true'] { background: var(--ok); border-color: var(--ok); }
.chip.bad[aria-pressed='true'] { background: var(--bad); border-color: var(--bad); }
.chip.warn[aria-pressed='true'] { background: var(--warn); border-color: var(--warn); }

/* Segmentierte Tabs */
.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: #e7ecea;
  border-radius: var(--r);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs button {
  border: 0;
  background: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 50, 79, 0.12); }
.tabs .count { font-size: var(--fs-xs); color: var(--faint); font-weight: 700; }

/* Suchbare Auswahlliste (Lehrkraft, Material) */
.picker { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.picker:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.picker .input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none !important; }
.picker-list { max-height: 228px; overflow-y: auto; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: var(--surface-2); }
.picker-item[aria-selected='true'] { background: var(--brand-soft); }
.picker-item[aria-selected='true']::after {
  content: 'check';
  font-family: 'Material Symbols Outlined';
  margin-left: auto;
  color: var(--brand);
  font-size: 20px;
}
.picker-item .t { font-weight: 600; }
.picker-item .s { font-size: var(--fs-xs); color: var(--muted); }
.picker-item:disabled { opacity: 0.45; cursor: not-allowed; }
.picker-empty { padding: 16px; color: var(--muted); font-size: var(--fs-sm); }

/* =========================================================================
   Etikett: der Material-Code im Stil eines Inventar-Aufklebers
   ========================================================================= */
.code-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--tag-ink);
  background: var(--tag);
  border: 1px solid var(--tag-line);
  border-radius: 4px 7px 7px 4px;
  padding: 2px 8px 2px 6px;
  white-space: nowrap;
  line-height: 1.5;
}
.code-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--tag-line);
}
.code-tag.lg { font-size: var(--fs-base); padding: 5px 12px 5px 9px; gap: 8px; }
.code-tag.lg::before { width: 8px; height: 8px; }

/* Status-Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  background: #edf0ef;
  color: var(--muted);
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plan { background: var(--plan-soft); color: var(--plan); }
.badge.plain::before { display: none; }

.cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  white-space: nowrap;
}
.cat::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c, var(--faint));
}

/* =========================================================================
   Tabellen (werden mobil zu Karten)
   ========================================================================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th .icon { font-size: 16px; vertical-align: -3px; }
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.table .title { font-weight: 600; }
.table .sub { font-size: var(--fs-xs); color: var(--muted); }

@media (max-width: 719px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { padding: 0; border: 0; }
  .table.responsive td[data-m='hide'] { display: none; }
  .table.responsive td[data-m='full'] { grid-column: 1 / -1; }
  .table.responsive td[data-m='right'] { text-align: right; grid-column: 2; grid-row: 1; align-self: start; }
  .table.responsive tr:has(td[data-m='right']) td:first-child { grid-column: 1; }
  .table.responsive .num { text-align: left; }
  .table.responsive td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
    font-size: var(--fs-xs);
  }
}

/* Filterleiste über Listen */
.toolbar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .input-icon { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 160px; flex: 0 1 200px; }
.toolbar .result-count { color: var(--muted); font-size: var(--fs-sm); margin-left: auto; }
@media (max-width: 719px) {
  .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .toolbar .result-count { width: 100%; margin: 0; }
}

/* =========================================================================
   Listen (Ausleihen, Aktivität)
   ========================================================================= */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none !important;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: var(--fs-sm); color: var(--muted); }
.list-item .end { text-align: right; font-size: var(--fs-sm); white-space: nowrap; }
.list-item .end strong { display: block; font-size: var(--fs-base); }
.list-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}
.list-icon .icon { font-size: 20px; }
.list-icon.ok { background: var(--ok-soft); color: var(--ok); }
.list-icon.warn { background: var(--warn-soft); color: var(--warn); }
.list-icon.bad { background: var(--bad-soft); color: var(--bad); }
.list-icon.plan { background: var(--plan-soft); color: var(--plan); }
.list-icon.brand { background: var(--brand-soft); color: var(--brand); }

/* Zeitleiste (Historie) */
.timeline { list-style: none; margin: 0; padding: 8px 20px 20px; }
.tl-item { display: grid; grid-template-columns: 38px 1fr; gap: 14px; position: relative; padding-top: 14px; }
.tl-item::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 52px;
  bottom: -14px;
  width: 2px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-item .when { font-size: var(--fs-xs); color: var(--muted); }
.tl-item .what { font-weight: 600; }
.tl-item .detail { font-size: var(--fs-sm); color: var(--ink-2); }
.tl-month {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  padding: 18px 0 2px 52px;
}

/* =========================================================================
   Dashboard
   ========================================================================= */
.greeting h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.025em; }
.greeting .lead { font-size: var(--fs-md); }
@media (max-width: 719px) { .greeting h1 { font-size: var(--fs-xl); } }

.stock {
  padding: 22px 24px 24px;
}
.stock-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stock-total { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stock-total small { font-size: var(--fs-base); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.stock-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7ecea;
  margin: 16px 0 16px;
  gap: 3px;
}
.stock-bar span { display: block; height: 100%; min-width: 0; transition: flex-grow 0.6s ease; }
.stock-bar .ok { background: var(--ok); }
.stock-bar .warn { background: #e09a2d; }
.stock-bar .bad { background: var(--bad); }
.stock-legend { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.stock-legend a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-sm);
}
.stock-legend a:hover .lbl { text-decoration: underline; }
.stock-legend .dot { width: 10px; height: 10px; border-radius: 3px; }
.stock-legend .val { font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.stock-legend .lbl { color: var(--muted); font-size: var(--fs-sm); }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.quick a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.quick a .icon { color: var(--brand); }
.quick a.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.quick a.primary .icon { color: var(--brand-ink); }
.quick a.primary:hover { background: var(--brand-hover); }
@media (max-width: 1023px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Fortschritt */
.progress { height: 8px; background: #e7ecea; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.4s ease; }
.progress.ok > span { background: var(--ok); }

/* =========================================================================
   Detail-Kopf (Material)
   ========================================================================= */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 24px;
  align-items: start;
}
.detail-hero h1 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: var(--fs-sm); }
.detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.detail-meta .icon { font-size: 18px; }
.qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  width: 132px;
  text-align: center;
}
.qr-box canvas, .qr-box img, .qr-box svg { width: 110px; height: 110px; display: block; margin: 0 auto; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts > div { padding: 14px 24px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts .k { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.facts .v { font-weight: 700; font-size: var(--fs-md); }
@media (max-width: 719px) {
  .detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .detail-hero .qr-box { display: none; }
  .facts > div { padding: 12px 14px; }
}

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.callout .icon { font-size: 20px; }
.callout.warn { background: var(--warn-soft); border-color: #f0d6a6; color: #6b4400; }
.callout.bad { background: var(--bad-soft); border-color: #f2c2bd; color: #7c1f19; }
.callout.ok { background: var(--ok-soft); border-color: #bfe3d0; color: #145c3d; }
.callout.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, white); }
.callout strong { display: block; font-size: var(--fs-base); }

/* =========================================================================
   Dialoge (native <dialog>), mobil als Bottom-Sheet
   ========================================================================= */
dialog.modal {
  border: 0;
  padding: 0;
  border-radius: var(--r-lg);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop 0.18s ease-out; }
dialog.modal::backdrop { background: rgba(13, 30, 48, 0.5); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: var(--fs-lg); }
.modal-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.modal-head .icon-btn { margin: -8px -10px 0 0; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
@media (max-width: 719px) {
  dialog.modal, dialog.modal.wide {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  dialog.modal[open] { animation: sheet 0.22s ease-out; }
  .modal-head { padding-top: 22px; position: relative; }
  .modal-head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--line-strong);
    transform: translateX(-50%);
  }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0.6; } }

/* =========================================================================
   Toasts
   ========================================================================= */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-pop);
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast .icon { font-size: 20px; }
.toast.ok .icon { color: #7fe0b0; }
.toast.bad { background: #7c1f19; }
.toast.bad .icon { color: #ffb4ad; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 719px) {
  .toasts { left: 16px; right: 16px; bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
}

/* =========================================================================
   Leer- und Ladezustände
   ========================================================================= */
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.empty .icon { font-size: 40px; color: var(--line-strong); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

.skeleton {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9eeec 0%, #f4f7f6 50%, #e9eeec 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-rows { padding: 18px 20px; display: grid; gap: 14px; }

/* =========================================================================
   Hilfsklassen
   ========================================================================= */
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide-mobile { }
@media (max-width: 719px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none !important; }
@media (max-width: 719px) { .only-mobile { display: revert !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Druck: nur Inhalt */
@media print {
  .sidebar, .topbar, .bottomnav, .toasts, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .panel { border-color: #ccc; }
}

/* =========================================================================
   Scanner
   ========================================================================= */
.scanner {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0d1e30;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(62%, 300px);
  aspect-ratio: 1;
  border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(13, 30, 48, 0.45);
  transition: box-shadow 0.2s;
}
.scanner-frame i {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  border-radius: 4px;
}
.scanner-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.scanner-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.scanner-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.scanner-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.scanner-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  top: 50%;
  background: color-mix(in srgb, var(--brand) 40%, white);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--brand) 60%, white);
  animation: scanline 2.2s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes scanline { 0%, 100% { top: 12%; } 50% { top: 88%; } }
.scanner.hit .scanner-frame i { border-color: #5fe3a1; }
.scanner.hit .scanner-frame { box-shadow: 0 0 0 100vmax rgba(31, 138, 91, 0.35); }
.scanner.paused .scanner-line { display: none; }
.scanner.paused video { filter: brightness(0.55) saturate(0.6); }
.scanner-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  color: #d7e1ea;
  background: #0d1e30;
  z-index: 2;
}
.scanner-msg .icon { font-size: 44px; color: #8ea3b8; }
.scanner-msg strong { color: #fff; font-size: var(--fs-md); }
.scanner-msg p { max-width: 40ch; font-size: var(--fs-sm); }
.scanner-msg .btn { margin-top: 8px; }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.scan-controls { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.scan-controls .btn[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.scan-recent .list-item { padding: 12px 16px; }

@media (max-width: 1023px) {
  .scan-layout { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  /* Kamera füllt die Breite randlos */
  .scan-page .scanner {
    margin: -18px -16px 0;
    border-radius: 0;
    aspect-ratio: auto;
    height: min(62vh, 520px);
  }
  .scan-page .page-head { display: none; }
}

/* Ergebnis-Karte nach dem Scan */
.result-head { display: flex; gap: 14px; align-items: flex-start; }
.result-head h2 { font-size: var(--fs-lg); margin: 6px 0 4px; }
.result-meta { display: grid; gap: 6px; margin-top: 14px; font-size: var(--fs-sm); }
.result-meta div { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.result-meta .icon { font-size: 18px; color: var(--muted); }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-actions .btn { width: 100%; }
.result-actions .wide { grid-column: 1 / -1; }

/* =========================================================================
   Inventur
   ========================================================================= */
.inv-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; padding: 20px 24px; align-items: center; }
.inv-progress { display: flex; align-items: center; gap: 14px; }
.inv-progress .progress { flex: 1; height: 10px; }
.inv-progress .pct { font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right; }
.inv-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: var(--fs-sm); color: var(--muted); }
.inv-stats strong { color: var(--ink); font-size: var(--fs-base); margin-right: 4px; }
.inv-scan { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; padding: 20px 24px; align-items: start; }
.inv-scan .scanner { aspect-ratio: 1; }
.inv-scan .scanner-frame { width: 70%; }
@media (max-width: 719px) {
  .inv-head { grid-template-columns: 1fr; padding: 16px; }
  .inv-scan { grid-template-columns: 1fr; padding: 16px; }
  .inv-scan .scanner { aspect-ratio: 4 / 3; }
}

/* Mengen-Stepper */
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); font-size: 28px; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover { background: #e7ecea; }
.stepper button:active { background: var(--line); }
.stepper input {
  border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; font-size: 2rem; font-weight: 800; height: 72px; width: 100%;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--brand-soft); }
.soll-hint { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }
.diff-pos { color: var(--ok); font-weight: 700; }
.diff-neg { color: var(--bad); font-weight: 700; }

.inv-card { display: flex; gap: 16px; align-items: center; padding: 20px 24px; }
.inv-card .grow { flex: 1; min-width: 0; }
@media (max-width: 719px) { .inv-card { flex-direction: column; align-items: stretch; padding: 16px; } }

/* Mobil: Seitenspalte (z.B. "Aktuell") vor der langen Historie zeigen */
@media (max-width: 1023px) {
  .grid-main-side > .stack:last-child { order: -1; }
}

/* =========================================================================
   Rechte
   ========================================================================= */
.perm-list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.perm {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.perm:last-child { border-bottom: 0; }
.perm:hover { background: var(--surface-2); }
.perm .icon { color: var(--muted); }
.perm .t { font-weight: 600; }
.perm .s { font-size: var(--fs-xs); color: var(--muted); }
.perm.locked { cursor: default; opacity: 0.6; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; margin-left: auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; z-index: 1; }
.switch span { pointer-events: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.15s;
}
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.perm-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-badges .badge { font-weight: 600; }
