/* Design-Tokens und geteilte Bausteine: siehe tokens.css
   (wird in index.html vor dieser Datei eingebunden). */
    body {
      font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
      background:
        radial-gradient(circle at 8% 8%, rgba(47, 143, 215, 0.16), transparent 36%),
        radial-gradient(circle at 92% 0%, rgba(255, 122, 26, 0.15), transparent 36%),
        linear-gradient(180deg, #f6f9ff 0%, #edf3ff 100%);
      color: var(--text);
    }
    .brand { font-weight: 700; letter-spacing: 2px; }
    .app-header {
      gap: 12px;
      flex-wrap: wrap;
    }
    .app-header-actions {
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .brand-logo-wrap {
      /* logo_text.png ist 420x280, davon nur 259x89 Inhalt (68% Weissrand).
         Der Header nutzt daher logo_text_compact.png (290x120, zugeschnitten)
         mit "contain" -- vorher schnitt "cover" die Stoppuhr oben und unten ab. */
      width: 180px;
      height: 74px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
    }
    .brand-logo {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: left center;
      display: block;
    }
    .card {
      position: relative;
      border-radius: var(--radius-panel);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-panel);
    }
    .card::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      /* Radius muss mitlaufen, sonst ragen die eckigen Enden der Akzentleiste
         ueber die abgerundeten Kartenecken hinaus. Kein overflow:hidden auf
         .card -- das wuerde das Einstellungen-Dropdown abschneiden. */
      border-radius: var(--radius-panel) var(--radius-panel) 0 0;
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
      opacity: 0.75;
      pointer-events: none;
    }
    .nav-pills .nav-link {
      color: var(--ink);
      border: 1px solid transparent;
      transition: all 0.2s ease;
    }
    .nav-pills .nav-link:hover {
      background: rgba(47, 143, 215, 0.08);
      border-color: rgba(47, 143, 215, 0.28);
    }
    .nav-pills .nav-link.active {
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 72%, var(--accent) 120%);
      color: #fff;
      box-shadow: 0 8px 18px rgba(18, 58, 132, 0.32);
    }
    .table td, .table th { vertical-align: middle; }
    .muted { color: var(--muted); }
    .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
    .btn-dark {
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 70%, var(--accent) 135%);
      border-color: var(--ink);
      color: #fff;
    }
    .btn-dark:hover {
      background: linear-gradient(135deg, #18448f 0%, #2460bf 60%, #ff8d39 130%);
      border-color: #18448f;
      color: #fff;
    }
    .btn-outline-dark {
      border-color: var(--accent-3);
      color: var(--accent-3);
      background: #fff;
    }
    .btn-outline-dark:hover {
      background: linear-gradient(180deg, rgba(47, 143, 215, 0.08) 0%, rgba(255, 122, 26, 0.08) 100%);
      border-color: #ff9a4f;
      color: var(--ink);
    }
    .btn-outline-secondary {
      border-color: var(--border-strong);
      color: #23457f;
    }
    .btn-outline-secondary:hover {
      background: rgba(47, 143, 215, 0.08);
      border-color: #98bae9;
      color: var(--ink-2);
    }
    .nav-item.dropdown { position: relative; }
    .nav-item.dropdown .dropdown-toggle::after {
      content: "▾";
      font-size: 11px;
      margin-left: 6px;
    }
    .nav-item.dropdown .dropdown-toggle {
      border: 1px solid transparent;
    }
    .nav-item.dropdown.open .dropdown-toggle {
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 70%, var(--accent) 130%);
      color: #fff;
      border-color: var(--accent-3);
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
    }
    .nav-item.dropdown .dropdown-toggle:hover {
      border-color: #9db8e8;
      background: rgba(47, 143, 215, 0.1);
    }
    .nav-item.dropdown .dropdown-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      min-width: 220px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 8px;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
      display: none;
      z-index: 20;
    }
    .nav-item.dropdown.open .dropdown-menu { display: block; }
    .dropdown-menu .nav-link {
      width: 100%;
      text-align: left;
      border-radius: 8px;
      padding: 8px 12px;
      color: var(--ink);
    }
    .dropdown-menu .nav-link:hover { background: rgba(47, 143, 215, 0.08); }
    .dropdown-menu .nav-link.active {
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 70%, var(--accent) 130%);
      color: #fff;
    }
    .nav-icon { margin-right: 8px; color: var(--accent); }
    .nav-pills .nav-link.active .nav-icon { color: #fff; }
    .page-title {
      display: inline-flex;
      align-items: center;
      gap: 10px;
    }
    .page-title-badge {
      width: 30px;
      height: 30px;
      border-radius: 9px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, var(--accent-3) 0%, var(--accent-2) 70%, var(--accent) 130%);
      color: #fff;
      box-shadow: 0 6px 14px rgba(16, 52, 107, 0.22);
      font-size: 15px;
      flex: 0 0 auto;
    }
    .table thead th {
      background: #f2f6ff;
      color: var(--ink);
      border-bottom-color: var(--border-strong);
      box-shadow: inset 0 2px 0 rgba(255, 122, 26, 0.45);
    }
    .table-striped > tbody > tr:nth-of-type(odd) > * {
      background: rgba(47, 143, 215, 0.035);
    }
    #report-context-note {
      border-color: #bdd7ee;
      background: #f2f8ff;
      color: var(--ink-2);
      font-size: 13px;
    }
    .form-control:focus,
    .form-select:focus {
      border-color: #6fa0e2;
      box-shadow: 0 0 0 0.2rem rgba(47, 143, 215, 0.16), 0 4px 12px rgba(21, 59, 122, 0.1);
    }
    #tab-abo .form-control[readonly] {
      background:
        repeating-linear-gradient(
          -45deg,
          rgba(47, 143, 215, 0.08),
          rgba(47, 143, 215, 0.08) 8px,
          rgba(21, 59, 122, 0.06) 8px,
          rgba(21, 59, 122, 0.06) 16px
        );
      border-color: #b4c7e8;
      color: #153b7a;
      font-weight: 600;
      cursor: not-allowed;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    }
    .form-select {
      border-color: var(--border-input);
      border-radius: 10px;
      background-color: #fff;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235a76a8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important;
      background-repeat: no-repeat !important;
      background-position: right 0.7rem center !important;
      background-size: 14px 14px !important;
      color: var(--ink-2);
      font-weight: 500;
      background-clip: padding-box;
      box-shadow: 0 2px 8px rgba(25, 63, 129, 0.08);
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }
    .form-select:hover {
      border-color: #9fbde7;
      background-color: #f7fbff;
    }
    .form-select:not([multiple]):not([size]) {
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      padding-right: 2rem;
    }
    .form-select[multiple],
    .form-select[size]:not([size="1"]) {
      background-image: none !important;
      padding-right: 0.75rem;
      min-height: 116px;
    }
    .time-filter-user-wrap {
      position: relative;
    }
    .time-filter-user-wrap .time-filter-user-icon {
      position: absolute;
      left: 11px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--accent-2);
      pointer-events: none;
      z-index: 2;
      font-size: 13px;
    }
    #time-filter-user {
      padding-left: 32px;
    }
    .alert-danger {
      color: #7f1d1d;
      background: #fff1ef;
      border-color: #ffc9c2;
    }
    .timeline-scale-axis {
      position: relative;
      width: 100%;
      height: 24px;
    }
    .timeline-scale-axis::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 15px;
      border-top: 1px solid #d7deea;
    }
    .timeline-scale-tick {
      position: absolute;
      top: 15px;
      height: 8px;
      border-left: 1px solid rgba(148, 163, 184, 0.8);
      transform: translateX(-0.5px);
    }
    .timeline-scale-tick.half {
      top: 18px;
      height: 5px;
      border-left-color: rgba(203, 213, 225, 0.95);
    }
    .timeline-scale-label {
      position: absolute;
      top: 0;
      font-size: 10px;
      line-height: 1;
      color: #9ca3af;
      white-space: nowrap;
      transform: translateX(-50%);
    }
    .timeline-scale-label.start {
      transform: none;
    }
    .timeline-grid-overlay {
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      z-index: 3;
      background-image:
        linear-gradient(90deg, rgba(148, 163, 184, 0.42) 0, rgba(148, 163, 184, 0.42) 1px, transparent 1px, transparent 100%),
        linear-gradient(90deg, rgba(203, 213, 225, 0.58) 0, rgba(203, 213, 225, 0.58) 1px, transparent 1px, transparent 100%);
      background-size: calc(100% / 24) 100%, calc(100% / 48) 100%;
      background-repeat: repeat-x, repeat-x;
      background-position: 0 0, 0 0;
    }
    .timeline-grid-overlay::after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      border-right: 1px solid rgba(148, 163, 184, 0.42);
    }
    .user-form-grid {
      display: grid;
      gap: 10px;
    }
    .user-form-group {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #fbfdff;
      padding: 10px 12px;
    }
    .user-form-group legend {
      float: none;
      width: auto;
      margin: 0;
      padding: 0 6px;
      font-size: 12px;
      color: var(--accent-3);
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .user-form-group legend i {
      margin-right: 4px;
      color: var(--accent-2);
    }
    .user-form-group .form-label {
      font-size: 12px;
      color: var(--label);
      margin-bottom: 4px;
    }
    .user-form-group .form-control,
    .user-form-group .form-select {
      padding: 6px 10px;
      font-size: 14px;
    }
    .th-two-line {
      line-height: 1.1;
      white-space: nowrap;
    }
    .th-two-line small {
      display: block;
      font-weight: 500;
      color: var(--label);
      margin-top: 2px;
    }
    .weekday-picker {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
    }
    .weekday-chip {
      border: 1px solid var(--border-strong);
      border-radius: 999px;
      padding: 4px 10px;
      font-size: 12px;
      background: #fff;
      color: var(--heading);
      cursor: pointer;
      user-select: none;
    }
    .weekday-chip input {
      margin-right: 5px;
      transform: translateY(1px);
    }
    .rule-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .rule-box {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px;
      background: #fcfdff;
    }
    .rule-step {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.03em;
      color: var(--accent-3);
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .rule-link {
      font-size: 12px;
      color: var(--muted);
      padding: 2px 0 0 2px;
    }
    /* ------------------------------------------------------------------
       Panel-Baustein: eine Definition fuer alle Bereiche. Die Klassen
       .master-card / .absence-section-card / .dashboard-section-card /
       .users-section-card waren vier byte-gleiche Kopien und sind jetzt
       Aliasse auf diesen Block.
       ------------------------------------------------------------------ */
    .section-card,
    .master-card,
    .absence-section-card,
    .dashboard-section-card,
    .users-section-card {
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-card);
      background: var(--surface-card);
      padding: 12px;
      box-shadow: var(--shadow-card);
      min-width: 0;
    }
    .section-head,
    .master-card .section-head,
    .absence-section-head,
    .users-section-head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      font-weight: 700;
      color: var(--heading);
    }
    .section-head i,
    .master-card .section-head i,
    .absence-section-head i,
    .users-section-head i {
      color: var(--accent-2);
    }
    .section-sub,
    .master-card .section-sub,
    .absence-section-sub,
    .users-section-sub {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .master-card.compact {
      padding: 10px;
    }
    .master-card.compact .row.g-2 {
      --bs-gutter-x: 0.5rem;
      --bs-gutter-y: 0.4rem;
    }
    .master-save-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border: 1px solid var(--border-soft);
      border-radius: 10px;
      background: var(--surface-tint);
    }
    .master-subtitle {
      font-size: 12px;
      font-weight: 700;
      color: #2a4d87;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      margin-bottom: 8px;
    }
    /* .absence-section-card / -head / -sub: siehe Panel-Baustein oben. */
    .dashboard-metric-grid {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .dashboard-metric-card {
      border: 1px solid var(--border-soft);
      border-radius: 12px;
      background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
      padding: 11px 12px;
      box-shadow: 0 8px 18px rgba(16, 52, 107, 0.06);
      min-width: 0;
    }
    .dashboard-metric-head {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 6px;
      font-size: 12px;
      font-weight: 700;
      color: var(--heading);
    }
    .dashboard-metric-head i {
      color: var(--accent-2);
    }
    .dashboard-metric-value {
      font-size: 28px;
      line-height: 1;
      font-weight: 700;
      color: var(--ink-2);
      margin-bottom: 4px;
    }
    .dashboard-metric-meta {
      font-size: 12px;
      color: var(--muted);
    }
    .dashboard-col-3 {
      grid-column: span 3;
    }
    .dashboard-col-6 {
      grid-column: span 6;
    }
    /* .dashboard-section-card: siehe Panel-Baustein oben. */
    .dashboard-metric-card,
    .dashboard-section-card {
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    #dashboard-conflicts-card {
      position: relative;
      overflow: hidden;
    }
    #dashboard-conflicts-card #stat-conflicts-list {
      overflow-y: auto;
      min-height: 0;
      padding-bottom: 22px;
    }
    #conflicts-scroll-hint {
      position: absolute;
      left: 50%;
      bottom: 8px;
      transform: translateX(-50%);
      width: 24px;
      height: 24px;
      border-radius: 999px;
      border: 1px solid rgba(95, 107, 134, 0.25);
      background: rgba(255, 255, 255, 0.92);
      color: rgba(47, 63, 120, 0.62);
      display: none;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      line-height: 1;
      pointer-events: none;
      box-shadow: 0 3px 10px rgba(16, 52, 107, 0.1);
    }
    .dashboard-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
      color: var(--heading);
      font-weight: 700;
    }
    .dashboard-section-head .label {
      display: inline-flex;
      align-items: center;
      gap: 7px;
    }
    .dashboard-section-head .label i {
      color: var(--accent-2);
    }
    @media (max-width: 1200px) {
      .dashboard-col-3 {
        grid-column: span 6;
      }
      .dashboard-col-6 {
        grid-column: span 12;
      }
    }
    @media (min-width: 1201px) {
      .dashboard-metric-grid {
        grid-auto-rows: 158px;
      }
      #dashboard-absences-card {
        grid-column: 1 / span 3;
        grid-row: 2;
      }
      #dashboard-trend-card {
        grid-column: 4 / span 3;
        grid-row: 2;
      }
      #dashboard-top3-card {
        grid-column: 1 / span 6;
        grid-row: 3;
      }
      #dashboard-conflicts-card {
        grid-column: 7 / span 6;
        grid-row: 2 / span 2;
      }
    }
    @media (max-width: 700px) {
      .dashboard-col-3,
      .dashboard-col-6 {
        grid-column: span 12;
      }
    }
    .users-settings-shell {
      display: grid;
      gap: 12px;
      margin-top: 10px;
      width: 100%;
      box-sizing: border-box;
    }
    #tab-users {
      max-width: 1180px;
      width: 100%;
      margin-inline: auto;
      box-sizing: border-box;
    }
    #tab-users .users-settings-shell {
      max-width: 1180px;
      margin-inline: auto;
    }
    /* .users-section-card / -head / -sub: siehe Panel-Baustein oben. */
    .users-section-card {
      width: 100%;
      box-sizing: border-box;
    }
    #tab-users .users-section-card:first-child {
      max-width: none;
    }
    #tab-users .users-section-card {
      max-width: 1180px;
      margin-inline: auto;
      overflow: hidden;
    }
    #tab-kiosks {
      max-width: 1180px;
      width: 100%;
      margin-inline: auto;
      box-sizing: border-box;
    }
    #tab-kiosks .kiosks-shell {
      display: grid;
      gap: 12px;
      margin-top: 10px;
      width: 100%;
      box-sizing: border-box;
    }
    #tab-kiosks .users-section-card {
      max-width: 1180px;
      margin-inline: auto;
      overflow: hidden;
    }
    #tab-kiosks .users-section-card .table-responsive {
      max-width: 100%;
      overflow-x: auto;
    }
    .kiosk-form-grid {
      --bs-gutter-x: 0.55rem;
      --bs-gutter-y: 0.5rem;
      align-items: stretch;
    }
    .kiosk-left-stack {
      display: grid;
      gap: 8px;
      height: 100%;
      align-content: center;
    }
    .kiosk-assigned-col {
      display: flex;
      flex-direction: column;
      min-height: 0;
    }
    .kiosk-assigned-select-wrap {
      flex: 1;
      display: flex;
      min-height: 0;
    }
    .kiosk-form-actions {
      margin-top: 0;
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .kiosk-form-footer {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 10px;
      margin-top: 4px;
    }
    #kiosk-assigned-users {
      flex: 1;
      min-height: 168px;
      background-color: #fff;
      border-color: var(--border-input);
      box-shadow: 0 2px 8px rgba(25, 63, 129, 0.08);
    }
    .kiosk-hint-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 0;
      justify-content: flex-end;
    }
    .kiosk-hint-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #2e4f84;
      border: 1px solid var(--border-soft);
      border-radius: 999px;
      padding: 5px 10px;
      background: var(--surface-tint-2);
      line-height: 1.1;
    }
    .kiosk-hint-chip i {
      color: var(--accent-2);
    }
    @media (max-width: 991px) {
      .kiosk-form-footer {
        flex-direction: column;
        align-items: stretch;
      }
      .kiosk-hint-row {
        justify-content: flex-start;
      }
    }
    .filter-icon-btn {
      width: 30px;
      min-width: 30px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    @media (min-width: 992px) {
      #tab-stammdaten .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
      }
    }
    .weekday-picker.compact {
      gap: 4px;
    }
    .weekday-picker.compact .weekday-chip {
      padding: 2px 7px;
      font-size: 11px;
    }
    .optional-block {
      border: 1px dashed var(--border-strong);
      border-radius: 10px;
      padding: 8px 10px;
      background: #f9fbff;
    }
    .optional-block.compact {
      padding: 6px 8px;
    }
    .optional-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: #2b4c86;
      font-weight: 600;
      user-select: none;
      margin-bottom: 4px;
    }
    .optional-summary {
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
      color: #2b4c86;
      list-style: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .optional-summary::-webkit-details-marker {
      display: none;
    }
    .optional-summary .opt-chevron {
      transition: transform 0.2s ease;
    }
    details[open] > .optional-summary .opt-chevron {
      transform: rotate(180deg);
    }
    .optional-info-box {
      border: 1px solid #d3e1f7;
      border-radius: 10px;
      background: linear-gradient(180deg, var(--surface-tint) 0%, #f1f7ff 100%);
      padding: 10px 12px;
      font-size: 12px;
      color: #34507f;
      height: 100%;
    }
    .optional-info-box .info-title {
      font-weight: 700;
      color: var(--heading);
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .optional-info-box ul {
      margin: 0;
      padding-left: 16px;
    }
    .optional-info-box li {
      margin-bottom: 4px;
      line-height: 1.35;
    }
    .optional-layout {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      min-width: 0;
    }
    .optional-section {
      border: 1px solid var(--border-soft);
      border-radius: 10px;
      background: #ffffff;
      padding: 10px;
      min-width: 0;
    }
    .optional-section-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--heading);
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.02em;
    }
    .optional-section .row {
      margin-top: 0 !important;
    }
    .optional-col-wide {
      grid-column: span 1;
    }
    .optional-col-narrow {
      grid-column: span 1;
    }
    .optional-col-full {
      grid-column: span 2;
    }
    @media (max-width: 1100px) {
      .optional-col-wide,
      .optional-col-narrow,
      .optional-col-full {
        grid-column: span 2;
      }
    }
    @media (max-width: 820px) {
      .optional-layout {
        grid-template-columns: 1fr;
      }
      .optional-col-wide,
      .optional-col-narrow,
      .optional-col-full {
        grid-column: span 1;
      }
    }
    .employment-type-only {
      display: none !important;
    }
    /* Mitarbeiter: kompakte Übersicht, Details im normalen Dokumentfluss. */
    .employee-page-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 14px;
    }
    .employee-page-head .page-title { margin: 0; }
    #tab-users .employee-directory { padding: 0; border: 0; box-shadow: none; background: transparent; }
    .employee-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 12px; }
    .employee-toolbar label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--label); }
    .employee-search-input { position: relative; }
    .employee-search-input > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--label); pointer-events: none; }
    .employee-search-input .form-control { padding-left: 38px; }
    .employee-toolbar .form-control, .employee-toolbar .form-select { width: 100%; min-width: 0; }
    .employee-list-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 10px; font-size: 12px; color: var(--muted); }
    .employee-list-meta p { margin: 0; }
    #employee-count { font-weight: 600; }
    .employee-list { display: grid; gap: 8px; min-width: 0; }
    .employee-list[aria-busy="true"] { opacity: .7; }
    .employee-card { border: 1px solid var(--border); border-radius: 12px; min-width: 0; background: var(--surface, #fff); }
    .employee-card.is-expanded { border-color: var(--border-strong); }
    .employee-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; padding: 4px 10px 4px 4px; gap: 4px; }
    .employee-toggle { display: grid; grid-template-columns: minmax(0, 1fr) 105px 76px 20px; align-items: center; gap: 18px; width: 100%; min-width: 0; border: 0; border-radius: 8px; padding: 12px; background: transparent; text-align: left; font: inherit; font-size: 14px; color: var(--ink); }
    .employee-toggle:hover, .employee-edit:hover { background: var(--surface-tint); }
    .employee-toggle:focus-visible, .employee-edit:focus-visible, .employee-remove:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
    .employee-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .employee-avatar { display: inline-flex; flex: 0 0 38px; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-tint); color: var(--ink); font-size: 13px; font-weight: 700; }
    .employee-name-wrap { min-width: 0; }
    .employee-name { display: block; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.35; }
    .employee-role { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
    .employee-hours { display: flex; flex-direction: column; gap: 2px; }
    .employee-hours strong { font-size: 15px; font-weight: 600; }
    .employee-hours > span { font-size: 11px; color: var(--muted); }
    .employee-status { justify-self: start; font-size: 12px; line-height: 1.3; font-weight: 600; border-radius: 20px; padding: 4px 9px; }
    .employee-status.is-active { color: #246449; background: #edf7f1; }
    .employee-status.is-inactive { color: #627084; background: #edf0f4; }
    .employee-chevron { display: inline-flex; justify-content: center; color: var(--muted); font-size: 14px; }
    .employee-card.is-expanded .employee-chevron { transform: rotate(180deg); }
    .employee-edit { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 16px; }
    .employee-edit:disabled, .employee-remove:disabled { opacity: .45; cursor: not-allowed; }
    .employee-details { padding: 18px 18px 10px; border-top: 1px solid var(--border); }
    .employee-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
    .employee-detail-group { min-width: 0; }
    .employee-detail-group h5 { margin: 0 0 12px; color: var(--ink); font-size: 13px; font-weight: 700; }
    .employee-detail-group dl { margin: 0; display: grid; gap: 12px; }
    .employee-field { min-width: 0; }
    .employee-field dt { color: var(--muted); font-size: 11px; font-weight: 500; margin-bottom: 2px; }
    .employee-field dd { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
    .employee-detail-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
    .employee-detail-footer p { margin: 0; font-size: 11px; color: var(--muted); flex: 1 1 220px; }
    .employee-remove { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; }
    .employee-remove:hover { color: var(--danger); background: #fff4f2; }
    .employee-detail-actions { display: flex; flex-wrap: wrap; gap: 4px; }
    .employee-exit-dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid var(--border); border-radius: 16px; padding: 24px; color: var(--ink); }
    .employee-exit-dialog::backdrop { background: rgb(12 30 60 / 45%); }
    .employee-exit-dialog h4 { font-size: 20px; }
    #employee-exit-name { font-weight: 600; overflow-wrap: anywhere; }
    #employee-exit-description { font-size: 14px; color: var(--muted); }
    .employee-exit-immediate { display: flex; align-items: start; gap: 9px; margin: 18px 0; font-size: 14px; }
    .employee-exit-immediate input { margin-top: 4px; }
    .employee-exit-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
    #employee-exit-error { color: var(--danger); font-size: 14px; }
    .time-archive-toggle { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
    .employee-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--border); border-radius: 12px; }
    .employee-empty strong { display: block; color: var(--ink); }
    .employee-empty p { margin: 6px 0 14px; }
    .employee-load-message { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
    @media (max-width: 800px) {
      .employee-toggle { grid-template-columns: minmax(0, 1fr) 76px 20px; gap: 10px; }
      .employee-identity { grid-column: 1; grid-row: 1; }
      .employee-status { grid-column: 2; grid-row: 1; }
      .employee-chevron { grid-column: 3; grid-row: 1 / 3; }
      .employee-hours { grid-column: 1 / 3; grid-row: 2; flex-direction: row; align-items: baseline; gap: 5px; padding-left: 50px; }
      .employee-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .employee-edit { width: 44px; height: 44px; }
      .employee-row { grid-template-columns: minmax(0, 1fr) 44px; padding-right: 6px; }
    }
    @media (max-width: 540px) {
      #tab-users { padding: 16px !important; }
      .employee-page-head { align-items: flex-start; }
      .employee-page-head > .btn { width: 100%; }
      .employee-toolbar { grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
      .employee-toolbar .form-control, .employee-toolbar .form-select { font-size: 16px; padding-top: 10px; padding-bottom: 10px; }
      .employee-toggle { grid-template-columns: minmax(0, 1fr) 56px 18px; padding: 10px 8px; gap: 8px; }
      .employee-identity { grid-column: 1 / 4; gap: 9px; }
      .employee-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
      .employee-name { font-size: 14px; }
      .employee-hours { grid-column: 1; grid-row: 2; padding-left: 41px; flex-wrap: wrap; gap: 1px 5px; }
      .employee-hours strong { font-size: 13px; }
      .employee-status { grid-column: 2; grid-row: 2; font-size: 11px; }
      .employee-chevron { grid-column: 3; grid-row: 2; }
      .employee-row { align-items: start; }
      .employee-edit { margin-top: 8px; }
      .employee-details { padding: 16px 14px 8px; }
      .employee-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
      .employee-detail-group dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
      .employee-detail-group h5 { font-size: 14px; }
      .employee-field dd { font-size: 13px; }
      .employee-remove { min-height: 44px; }
    }
    .rfid-learn-toast {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 1300;
      display: none;
      align-items: center;
      gap: 12px;
      width: min(420px, calc(100vw - 24px));
      min-width: 0;
      padding: 12px 14px;
      border: 1px solid #ffd38a;
      border-radius: 12px;
      background: linear-gradient(140deg, #fffaf0 0%, #fff3da 100%);
      box-shadow: 0 12px 28px rgba(23, 32, 52, 0.2);
    }
    .rfid-learn-toast strong {
      display: block;
      color: #7a4a00;
      line-height: 1.1;
    }
    .rfid-learn-toast .muted {
      color: #7f5b1e;
      font-size: 13px;
    }
    .rfid-learn-toast .rfid-input-row {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }
    .rfid-learn-toast .rfid-actions-row {
      display: flex;
      justify-content: flex-end;
      margin-top: 8px;
    }
    .rfid-learn-toast .rfid-input-row input {
      min-width: 170px;
      font-size: 13px;
      padding: 0.3rem 0.5rem;
    }
    .rfid-anim {
      width: 56px;
      height: 42px;
      position: relative;
      flex: 0 0 auto;
    }
    .rfid-anim .reader {
      position: absolute;
      right: 2px;
      top: 9px;
      font-size: 24px;
      color: #b66a00;
    }
    .rfid-anim .hand {
      position: absolute;
      left: 0;
      top: 10px;
      font-size: 22px;
      color: #dc8a00;
      animation: rfidHandMove 1s ease-in-out infinite;
    }
    @keyframes rfidHandMove {
      0% { transform: translateX(0); opacity: 0.75; }
      50% { transform: translateX(18px); opacity: 1; }
      100% { transform: translateX(0); opacity: 0.75; }
    }
    .auth-shell {
      background: linear-gradient(135deg, rgba(15, 47, 111, 0.06) 0%, rgba(47, 143, 215, 0.08) 56%, rgba(255, 122, 26, 0.1) 100%);
      border: 1px solid #d4def2;
      border-radius: 18px;
      padding: 18px;
    }
    .auth-grid {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 16px;
      align-items: stretch;
    }
    .auth-panel {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      box-shadow: 0 8px 20px rgba(17, 40, 70, 0.08);
    }
    .auth-panel h3 {
      margin-bottom: 4px;
      color: var(--ink);
    }
    .auth-subtitle {
      color: var(--muted);
      margin-bottom: 14px;
      font-size: 14px;
    }
    .auth-info {
      background: linear-gradient(160deg, var(--ink) 0%, var(--accent-3) 58%, var(--accent-2) 100%);
      color: var(--surface-tint);
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 14px;
      box-shadow: 0 12px 24px rgba(15, 47, 111, 0.22);
    }
    .auth-info h4 {
      font-size: 18px;
      margin: 0 0 8px;
      color: #fff;
    }
    .auth-info p {
      margin: 0;
      color: rgba(241, 247, 255, 0.92);
      line-height: 1.4;
    }
    .auth-chip-list {
      display: grid;
      gap: 8px;
      margin-top: 6px;
    }
    .auth-chip {
      font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 12px;
      padding: 7px 10px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.3);
      background: rgba(255, 255, 255, 0.1);
      color: #eef4ff;
      width: fit-content;
    }
    .support-chat-launcher {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 1100;
      border: 1px solid var(--accent-3);
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 68%, var(--accent) 130%);
      color: #fff;
      border-radius: 999px;
      padding: 10px 14px;
      font-weight: 700;
      box-shadow: 0 10px 22px rgba(16, 52, 107, 0.35);
      display: none;
    }
    .support-chat-window {
      position: fixed;
      right: 18px;
      bottom: 66px;
      width: min(420px, calc(100vw - 20px));
      height: min(560px, calc(100vh - 100px));
      z-index: 1100;
      border: 1px solid #cbd9f2;
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 14px 26px rgba(16, 52, 107, 0.24);
      display: none;
      grid-template-rows: auto 1fr auto;
      overflow: hidden;
    }
    .support-chat-head {
      padding: 10px 12px;
      color: #fff;
      background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 70%, var(--accent-2) 120%);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }
    .support-chat-close {
      border: 1px solid rgba(255, 255, 255, 0.4);
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      border-radius: 8px;
      padding: 4px 8px;
      line-height: 1;
      font-size: 14px;
    }
    .support-chat-list {
      padding: 10px;
      overflow: auto;
      background: #f7faff;
      display: grid;
      gap: 8px;
      align-content: start;
    }
    .support-chat-item {
      border: 1px solid #d9e4f7;
      border-radius: 8px;
      background: #fff;
      padding: 7px 9px;
    }
    .support-chat-item .meta {
      color: #60708e;
      font-size: 11px;
      margin-bottom: 3px;
    }
    .support-chat-item.admin {
      border-color: #bcd3f8;
      background: #eef5ff;
    }
    .support-chat-item.bot {
      border-color: #fde2c8;
      background: #fff7ef;
    }
    .support-chat-item.operator {
      border-color: #cde9d8;
      background: #effaf3;
    }
    .support-chat-compose {
      border-top: 1px solid #dce6f8;
      padding: 10px;
      display: grid;
      gap: 8px;
      background: #fff;
    }
    .support-chat-status {
      font-size: 12px;
      color: #60708e;
      min-height: 16px;
    }
    .qr-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1050;
    }
    .qr-modal.show { display: flex; }
    .qr-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
    }
    .qr-modal-content {
      position: relative;
      background: #fff;
      border-radius: 12px;
      padding: 16px;
      width: min(420px, 92vw);
      box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
      z-index: 1;
    }
    .qr-modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .qr-modal-title { font-weight: 700; }
    .qr-preview { display: flex; align-items: center; justify-content: center; margin-top: 12px; }
    .qr-preview img { width: min(300px, 70vw); height: auto; }
    .qr-modal-text {
      word-break: break-all;
      font-size: 12px;
    }
    #users-form-card.user-form-popup-mode {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 1051;
      width: min(1100px, 96vw);
      max-height: 92vh;
      overflow: auto;
      box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
    }
    #users-form-card.user-form-popup-mode .users-section-sub {
      margin-bottom: 8px;
    }
    #user-form-popup-backdrop.show {
      display: block !important;
    }
    @media (max-width: 992px) {
      .auth-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 1024px) {
      body { font-size: 18px; }
      .btn { padding: 12px 16px; font-size: 16px; }
      .form-control, .form-select { padding: 12px 14px; font-size: 16px; }
      .nav-pills .nav-link { padding: 12px 18px; font-size: 16px; }
      .table { font-size: 16px; }
      .card { padding: 18px; }
    }

    @media (max-width: 576px) {
      body { font-size: 16px; }
      #tabs { position: relative; }
      #settings-menu { position: static; }
      #settings-menu .dropdown-menu {
        left: 0;
        right: 0;
        min-width: 0;
      }
      .container.py-4 {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
      }
      .app-header {
        align-items: flex-start !important;
      }
      .brand-logo-wrap {
        width: min(280px, 100%);
        height: 58px;
      }
      .app-header-actions {
        width: 100%;
        justify-content: flex-start;
      }
      .app-header-actions .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        white-space: nowrap;
      }
      #btn-logout {
        flex-basis: 100%;
      }
      .card {
        padding: 14px !important;
      }
    }
    /* ==================================================================
       Firmenkontext im Header
       ================================================================== */
    .app-context {
      display: flex;
      flex-direction: column;
      gap: 1px;
      padding-left: 14px;
      margin-left: 12px;
      border-left: 1px solid var(--border);
      min-width: 0;
    }
    .app-context .ctx-company {
      font-weight: 700;
      font-size: 14px;
      color: var(--heading);
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .app-context .ctx-user {
      font-size: 12px;
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    @media (max-width: 576px) {
      .app-context {
        padding-left: 0;
        margin-left: 0;
        border-left: none;
        margin-top: 6px;
      }
    }

    /* Dashboard-Kacheln im Ladezustand (Skeleton-Basis: tokens.css). */
    .metric-loading .dashboard-metric-value {
      color: transparent;
      border-radius: 6px;
      background: linear-gradient(90deg, #e9eff8 0%, #f5f8fd 40%, #e9eff8 80%);
      background-size: 240% 100%;
      animation: skeleton-shimmer 1.25s ease-in-out infinite;
    }
