    /* ============================================================
       DIGICHECK · Design Tokens
       ============================================================ */

    :root {
      --bg: #030712;
      --panel: rgba(15, 23, 42, 0.88);
      --panel-soft: rgba(15, 23, 42, 0.72);
      --panel-dark: rgba(2, 6, 23, 0.72);
      --border: rgba(148, 163, 184, 0.18);
      --text: #e5e7eb;
      --muted: #94a3b8;
      --muted-dark: #64748b;
      --blue: #3b82f6;
      --blue-dark: #2563eb;
      --green: #22c55e;
      --yellow: #f59e0b;
      --red: #ef4444;
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
      --radius: 22px;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      min-height: 100%;
    }

    body {
      margin: 0;
      font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.18), transparent 32%),
        radial-gradient(circle at 86% 10%, rgba(139, 92, 246, 0.16), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.08), transparent 30%),
        var(--bg);
      overflow-x: hidden;
    }

    button,
    input,
    select,
    textarea {
      font-family: inherit;
    }

    button {
      cursor: pointer;
    }

    code {
      color: #bfdbfe;
    }

    /* ============================================================
       Branding
       ============================================================ */

    .brand {
      font-size: 1.7rem;
      font-weight: 900;
      line-height: 1;
      letter-spacing: -0.05em;
      text-transform: uppercase;
      user-select: none;
    }

    .brand .digi {
      color: var(--blue);
    }

    .brand .suffix {
      color: var(--muted);
    }

    .pill {
      display: inline-flex;
      align-items: center;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 7px 10px;
      color: var(--muted);
      background: rgba(15, 23, 42, 0.7);
      font-size: 0.75rem;
      font-weight: 800;
      white-space: nowrap;
    }

    /* ============================================================
       Common Layout
       ============================================================ */

    .screen {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 24px;
    }

    .grid {
      display: grid;
      gap: 18px;
    }

    .grid-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .card {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: var(--shadow);
      padding: 20px;
      backdrop-filter: blur(18px);
    }

    .card h2,
    .card h3 {
      margin: 0 0 12px;
      letter-spacing: -0.035em;
    }

    .card h2 {
      font-size: 1.22rem;
    }

    .card h3 {
      font-size: 1.05rem;
    }

    .card p {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.55;
    }

    .subtle {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.55;
    }

    /* ============================================================
       Unteranwendungsauswahl
       ============================================================ */

    .selector-wrap {
      width: min(880px, 100%);
    }

    .selector-minimal {
      display: grid;
      justify-items: center;
      gap: 42px;
      text-align: center;
    }

    .selector-logo {
      font-size: clamp(4rem, 13vw, 9.5rem);
      letter-spacing: -0.08em;
    }

    .choice-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      width: 100%;
    }

    .choice-card {
      min-height: 82px;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 22px 24px;
      color: var(--text);
      text-align: center;
      background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.64));
      box-shadow: var(--shadow);
      font-size: clamp(1rem, 2vw, 1.25rem);
      font-weight: 900;
      letter-spacing: -0.035em;
      transition: 0.18s ease;
    }

    .choice-card:hover {
      transform: translateY(-3px);
      border-color: rgba(59, 130, 246, 0.55);
    }

    /* ============================================================
       Login
       ============================================================ */

    .login-screen {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 24px;
    }

    .login-card {
      width: min(520px, 100%);
      display: grid;
      border: 1px solid var(--border);
      border-radius: 32px;
      background: rgba(15, 23, 42, 0.74);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .login-form {
      padding: 42px;
      background: rgba(3, 7, 18, 0.42);
    }

    .login-form-minimal {
      display: grid;
      gap: 24px;
      text-align: center;
    }

    .login-logo {
      font-size: clamp(3rem, 10vw, 5.6rem);
      letter-spacing: -0.08em;
    }

    .login-form h1 {
      margin: 0;
      font-size: clamp(1.8rem, 4vw, 2.6rem);
      letter-spacing: -0.055em;
    }

    .login-back-row {
      margin-top: -4px;
      justify-content: center;
    }

    /* ============================================================
       App Shell
       ============================================================ */

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 292px 1fr;
    }

    .sidebar {
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
      border-right: 1px solid var(--border);
      padding: 22px;
      background: rgba(3, 7, 18, 0.76);
      backdrop-filter: blur(20px);
    }

    .sidebar-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 22px;
    }

    .nav-group {
      margin: 18px 0;
    }

    .nav-title {
      margin: 0 0 8px 9px;
      color: var(--muted-dark);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .nav-btn {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      border: 1px solid transparent;
      border-radius: 16px;
      padding: 12px 13px;
      color: var(--muted);
      background: transparent;
      text-align: left;
      font-size: 0.93rem;
      font-weight: 700;
      transition: 0.18s ease;
    }

    .nav-btn:hover {
      color: var(--text);
      background: rgba(148, 163, 184, 0.08);
    }

    .nav-btn.active {
      color: white;
      border-color: rgba(59, 130, 246, 0.42);
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.06));
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    }

    .nav-icon {
      width: 20px;
      text-align: center;
      opacity: 0.9;
    }

    .main {
      min-width: 0;
      padding: 28px;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 18px;
      margin-bottom: 24px;
    }

    .headline h1 {
      margin: 0;
      font-size: clamp(1.7rem, 2.4vw, 3rem);
      line-height: 1.04;
      letter-spacing: -0.055em;
    }

    .headline p {
      max-width: 720px;
      margin: 10px 0 0;
      color: var(--muted);
      line-height: 1.55;
    }

    .user-card {
      min-width: 245px;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 14px;
      background: rgba(15, 23, 42, 0.76);
      box-shadow: var(--shadow);
    }

    .user-card strong,
    .user-card span {
      display: block;
    }

    .user-card strong {
      font-size: 0.92rem;
    }

    .user-card span {
      margin-top: 5px;
      color: var(--muted);
      font-size: 0.78rem;
      word-break: break-word;
    }

    .refresh-btn {
      width: 100%;
      margin-top: 12px;
      justify-content: center;
      color: var(--muted);
      border-color: rgba(148, 163, 184, 0.16);
      background: rgba(15, 23, 42, 0.66);
      opacity: 0.58;
    }

    .refresh-btn.ready {
      color: #dcfce7;
      border-color: rgba(34, 197, 94, 0.55);
      background: rgba(34, 197, 94, 0.18);
      opacity: 1;
    }

    .refresh-btn:disabled {
      cursor: not-allowed;
    }

    .view {
      display: none;
      animation: fade 0.18s ease;
    }

    .view.active {
      display: block;
    }

    @keyframes fade {
      from {
        opacity: 0;
        transform: translateY(4px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }

    /* ============================================================
       Components
       ============================================================ */

    .metric {
      min-height: 135px;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 14px;
      position: relative;
      overflow: hidden;
    }

    .metric::after {
      content: "";
      position: absolute;
      top: -30px;
      right: -30px;
      width: 120px;
      height: 120px;
      background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
    }

    .metric-value {
      font-size: 2.2rem;
      font-weight: 900;
      letter-spacing: -0.06em;
    }

    .metric-label {
      margin-top: 4px;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 700;
    }

    .btn-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    .btn {
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 10px 13px;
      color: var(--text);
      background: rgba(15, 23, 42, 0.82);
      font-size: 0.87rem;
      font-weight: 800;
      transition: 0.18s ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      border-color: rgba(148, 163, 184, 0.38);
    }

    .btn.primary {
      color: white;
      border-color: rgba(96, 165, 250, 0.7);
      background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    }

    .btn.good {
      color: white;
      border-color: rgba(34, 197, 94, 0.65);
      background: linear-gradient(135deg, #16a34a, #15803d);
    }

    .btn.warn {
      color: white;
      border-color: rgba(245, 158, 11, 0.65);
      background: linear-gradient(135deg, #f59e0b, #b45309);
    }

    .btn.danger {
      color: white;
      border-color: rgba(239, 68, 68, 0.65);
      background: linear-gradient(135deg, #ef4444, #b91c1c);
    }

    .btn.ghost {
      background: transparent;
    }

    .btn.full {
      width: 100%;
    }

    .form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .form.one {
      grid-template-columns: 1fr;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .field.full {
      grid-column: 1 / -1;
    }

    label {
      color: #cbd5e1;
      font-size: 0.78rem;
      font-weight: 800;
    }

    input,
    select,
    textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 11px 12px;
      color: var(--text);
      background: rgba(2, 6, 23, 0.72);
      outline: none;
      font-size: 0.92rem;
    }

    textarea {
      min-height: 88px;
      resize: vertical;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: rgba(59, 130, 246, 0.7);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    }

    .table-wrap {
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 18px;
    }

    table {
      width: 100%;
      min-width: 760px;
      border-collapse: collapse;
    }

    th,
    td {
      padding: 13px 14px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.12);
      text-align: left;
      vertical-align: top;
    }

    th {
      color: #cbd5e1;
      background: rgba(15, 23, 42, 0.8);
      font-size: 0.76rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    td {
      color: #e2e8f0;
      font-size: 0.88rem;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 5px 8px;
      font-size: 0.72rem;
      font-weight: 900;
      white-space: nowrap;
    }

    .badge.blue {
      color: #bfdbfe;
      border-color: rgba(59, 130, 246, 0.35);
      background: rgba(59, 130, 246, 0.15);
    }

    .badge.green {
      color: #bbf7d0;
      border-color: rgba(34, 197, 94, 0.35);
      background: rgba(34, 197, 94, 0.13);
    }

    .badge.yellow {
      color: #fde68a;
      border-color: rgba(245, 158, 11, 0.35);
      background: rgba(245, 158, 11, 0.13);
    }

    .badge.red {
      color: #fecaca;
      border-color: rgba(239, 68, 68, 0.35);
      background: rgba(239, 68, 68, 0.13);
    }

    .badge.gray {
      color: #cbd5e1;
      border-color: rgba(148, 163, 184, 0.22);
      background: rgba(148, 163, 184, 0.11);
    }

    /* ============================================================
       Modal, Toast, Scanner, Print
       ============================================================ */

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: none;
      place-items: center;
      padding: 18px;
      background: rgba(0, 0, 0, 0.64);
    }

    .modal-backdrop.active {
      display: grid;
    }

    .modal {
      width: min(760px, 100%);
      max-height: 90vh;
      overflow: auto;
      border: 1px solid var(--border);
      border-radius: 26px;
      padding: 20px;
      background: #0f172a;
      box-shadow: var(--shadow);
    }

    .modal-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 16px;
    }

    .modal-head h2 {
      margin: 0;
      letter-spacing: -0.04em;
    }

    .toast {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 80;
      width: min(390px, calc(100vw - 36px));
      display: grid;
      gap: 10px;
    }

    .toast-item {
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 13px 14px;
      color: var(--text);
      background: rgba(15, 23, 42, 0.96);
      box-shadow: var(--shadow);
      line-height: 1.45;
    }

    #reader {
      width: 100%;
      min-height: 280px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border: 1px dashed rgba(148, 163, 184, 0.35);
      border-radius: 20px;
      background: rgba(2, 6, 23, 0.6);
    }

    video {
      width: 100%;
      border-radius: 18px;
    }

    .logging-scan-mode #loggingResultCard {
      display: none;
    }

    .logging-result-mode #loggingScannerCard {
      display: none;
    }

    .logging-compact-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 12px;
    }

    .logging-token-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      margin-top: 12px;
    }

    @media (max-width: 640px) {
      .logging-compact-actions,
      .logging-token-row {
        grid-template-columns: 1fr;
      }
    }

    .mobile-toggle {
      display: none;
    }

    .print-area {
      display: none;
    }

    .job-order-document {
      font-family: Inter, Arial, sans-serif;
      color: #0f172a;
      background: #f8fafc;
      padding: 28px;
    }

    .job-order-page {
      width: 100%;
      max-width: 920px;
      margin: 0 auto 28px;
      border: 1px solid #cbd5e1;
      border-radius: 20px;
      background: #ffffff;
      overflow: hidden;
      page-break-after: always;
      break-after: page;
    }

    .job-order-page:last-child {
      page-break-after: auto;
      break-after: auto;
    }

    .job-order-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 18px;
      padding: 24px;
      background: #020617;
      color: #e5e7eb;
    }

    .job-order-brand {
      font-weight: 900;
      letter-spacing: -0.05em;
      font-size: 28px;
      text-transform: uppercase;
    }

    .job-order-meta {
      text-align: right;
      color: #cbd5e1;
      font-size: 12px;
      line-height: 1.6;
    }

    .job-order-body {
      padding: 24px;
      display: grid;
      grid-template-columns: 1fr 190px;
      gap: 22px;
    }

    .job-order-section {
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      overflow: hidden;
      margin-bottom: 14px;
    }

    .job-order-section h3 {
      margin: 0;
      padding: 10px 12px;
      background: #f1f5f9;
      color: #334155;
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .job-order-row {
      display: grid;
      grid-template-columns: 180px 1fr;
      border-top: 1px solid #e2e8f0;
      min-height: 38px;
    }

    .job-order-row:first-of-type {
      border-top: 0;
    }

    .job-order-row strong,
    .job-order-row span {
      padding: 10px 12px;
      font-size: 13px;
      line-height: 1.35;
    }

    .job-order-row strong {
      background: #f8fafc;
      color: #475569;
    }

    .job-order-row span {
      color: #0f172a;
    }

    .job-order-qr-box {
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 14px;
      text-align: center;
      background: #ffffff;
      align-self: start;
    }

    .job-order-qr-box img {
      width: 160px;
      height: 160px;
      image-rendering: pixelated;
    }

    .job-order-token {
      margin-top: 8px;
      color: #475569;
      font-size: 10px;
      word-break: break-all;
    }

    .job-order-warning {
      margin-top: 14px;
      border: 1px solid #f59e0b;
      border-radius: 12px;
      padding: 12px;
      color: #92400e;
      background: #fffbeb;
      font-size: 13px;
      line-height: 1.45;
    }

    .job-order-footer {
      padding: 14px 24px 22px;
      color: #64748b;
      font-size: 11px;
      line-height: 1.45;
    }

    .billing-document {
      font-family: Inter, Arial, sans-serif;
      color: #0f172a;
      background: #f8fafc;
      padding: 28px;
    }

    .billing-page {
      width: 100%;
      max-width: 1080px;
      margin: 0 auto;
      border: 1px solid #cbd5e1;
      border-radius: 20px;
      background: #ffffff;
      overflow: hidden;
    }

    .billing-header {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      padding: 24px;
      background: #020617;
      color: #e5e7eb;
    }

    .billing-brand {
      font-weight: 900;
      letter-spacing: -0.05em;
      font-size: 28px;
      text-transform: uppercase;
    }

    .billing-meta {
      text-align: right;
      color: #cbd5e1;
      font-size: 12px;
      line-height: 1.6;
    }

    .billing-body {
      padding: 24px;
    }

    .billing-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 18px;
    }

    .billing-summary-card {
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      padding: 14px;
      background: #f8fafc;
    }

    .billing-summary-card strong {
      display: block;
      color: #0f172a;
      font-size: 22px;
      letter-spacing: -0.04em;
    }

    .billing-summary-card span {
      display: block;
      margin-top: 4px;
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
    }

    .billing-table {
      width: 100%;
      border-collapse: collapse;
    }

    .billing-table th,
    .billing-table td {
      border-bottom: 1px solid #e2e8f0;
      padding: 9px 10px;
      color: #0f172a;
      text-align: left;
      font-size: 11px;
      vertical-align: top;
    }

    .billing-table th {
      background: #f1f5f9;
      color: #334155;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .tree {
      display: grid;
      gap: 12px;
    }

    details.tree-node {
      border: 1px solid var(--border);
      border-radius: 18px;
      background: rgba(2, 6, 23, 0.36);
      overflow: hidden;
    }

    details.tree-node > summary {
      list-style: none;
      cursor: pointer;
      padding: 14px 16px;
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: center;
      font-weight: 900;
      color: var(--text);
    }

    details.tree-node > summary::-webkit-details-marker {
      display: none;
    }

    details.tree-node > summary::before {
      content: "▸";
      color: var(--blue);
      margin-right: 4px;
    }

    details.tree-node[open] > summary::before {
      content: "▾";
    }

    .tree-body {
      border-top: 1px solid rgba(148, 163, 184, 0.12);
      padding: 14px;
      display: grid;
      gap: 10px;
    }

    .warning-box {
      border: 1px solid rgba(245, 158, 11, 0.45);
      background: rgba(245, 158, 11, 0.10);
      color: #fde68a;
      border-radius: 16px;
      padding: 12px;
      line-height: 1.45;
      font-size: 0.86rem;
    }

    .mark-warning {
      box-shadow: inset 4px 0 0 rgba(245, 158, 11, 0.9);
      background: rgba(245, 158, 11, 0.06);
    }

    .muted-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    /* ============================================================
       Responsive
       ============================================================ */

    @media (max-width: 980px) {
      .choice-grid,
      .grid-2,
      .grid-3,
      .grid-4 {
        grid-template-columns: 1fr;
      }

      .app {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 40;
        width: 300px;
        max-width: 85vw;
        transform: translateX(-105%);
        transition: 0.22s ease;
      }

      .sidebar.open {
        transform: none;
      }

      .main {
        padding: 18px;
      }

      .mobile-toggle {
        display: inline-flex;
      }

      .form {
        grid-template-columns: 1fr;
      }

      .topbar {
        flex-direction: column;
      }

      .user-card {
        width: 100%;
      }

      .login-card {
        grid-template-columns: 1fr;
      }

      .login-hero,
      .login-form {
        padding: 26px;
      }
    }

    @media print {
      body {
        color: #111827;
        background: white;
      }

      .app,
      .login-screen,
      .selector-screen,
      .modal-backdrop,
      .toast {
        display: none !important;
      }

      .print-area {
        display: block;
        padding: 0;
        background: white;
      }

      .job-order-document {
        padding: 0;
        background: white;
      }

      .job-order-page {
        max-width: none;
        width: auto;
        margin: 0;
        border-radius: 0;
        border: 0;
        min-height: 100vh;
        page-break-after: always;
        break-after: page;
      }

      .job-order-page:last-child {
        page-break-after: auto;
        break-after: auto;
      }

      .billing-document {
        padding: 0;
        background: white;
      }

      .billing-page {
        max-width: none;
        width: auto;
        margin: 0;
        border-radius: 0;
        border: 0;
      }

      .billing-summary {
        grid-template-columns: repeat(4, 1fr);
      }
    }
  

    .sort-btn {
      appearance: none;
      border: 0;
      background: transparent;
      color: inherit;
      padding: 0;
      font: inherit;
      font-weight: 900;
      letter-spacing: inherit;
      text-transform: inherit;
    }

    .sort-btn.active {
      color: #93c5fd;
    }

    tr.mark-selected td {
      background: rgba(59, 130, 246, 0.18);
    }
