@layer app, util;

@layer app {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --blue: #1a56db; --blue-light: #eff3ff;
    --green: #057a55; --green-light: #f0fdf4; --green-border: #bbf7d0;
    --orange: #c27803; --orange-light: #fffbeb;
    --red: #c81e1e; --red-light: #fef2f2; --red-border: #fecaca;
    --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
    --gray-300: #d1d5db; --gray-400: #9ca3af;
    --gray-500: #6b7280; --gray-700: #374151; --gray-900: #111827;
    --surface: #ffffff;
    --white: #ffffff;
    --orange-50: #fff7ed; --orange-100: #ffedd5; --orange-200: #fed7aa; --orange-400: #fb923c; --orange-500: #f97316; --orange-600: #ea580c; --orange-700: #c2410c;
    --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-300: #fcd34d; --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-600: #d97706; --amber-700: #b45309; --amber-800: #92400e;
    --yellow-100: #fef9c3; --yellow-800: #854d0e;
    --teal-600: #0d9488;
    --cyan-600: #0891b2;
    --sky-100: #e0f2fe; --sky-700: #0369a1;
    --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-300: #93c5fd; --blue-400: #60a5fa; --blue-500: #3b82f6; --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-800: #1e40af; --blue-dark: #1e429f; --blue-border: #c3d3f7;
    --violet-50: #f5f3ff; --violet-200: #ddd6fe; --violet-400: #a78bfa; --violet-500: #8b5cf6; --violet-600: #7c3aed; --violet-700: #6d28d9;
    --purple-50: #faf5ff; --purple-100: #f3e8ff; --purple-200: #e9d5ff; --purple-700: #7e22ce;
    --gray-600: #4b5563; --gray-800: #1f2937;
    --teal-50: #f0fdfa; --teal-700: #0f766e;
    --pink-50: #fdf2f8; --pink-700: #be185d;
    --lime-100: #ecfccb; --lime-800: #3f6212;
  }

  [data-theme="dark"] {
    --blue: #4d7ce8; --blue-light: #1a2d55;
    --green: #2dbd91; --green-light: #0d2820; --green-border: #1c4a30;
    --orange: #f0a428; --orange-light: #392b14;
    --red: #f05252; --red-light: #3a1a1c; --red-border: #5c2326;
    --gray-50: #111318; --gray-100: #1c1f2b; --gray-200: #2a2f42;
    --gray-300: #3d4566; --gray-400: #6b7280;
    --gray-500: #9ca3af; --gray-700: #d1d5db; --gray-900: #f3f4f6;
    --surface: #1c1f2b;
    --orange-50: #2e1f12; --orange-100: #3b2614; --orange-200: #5a3517; --orange-400: #fb923c; --orange-500: #fb923c; --orange-600: #f97316; --orange-700: #fb923c;
    --amber-50: #2b2412; --amber-100: #3a2e12; --amber-200: #5c4716; --amber-300: #7a5d18; --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-600: #f59e0b; --amber-700: #fbbf24; --amber-800: #fcd34d;
    --yellow-100: #36320f; --yellow-800: #fde047;
    --teal-600: #2dd4bf;
    --cyan-600: #22d3ee;
    --sky-100: #0f2a3a; --sky-700: #7dd3fc;
    --blue-50: #172340; --blue-100: #1b2b50; --blue-200: #26407a; --blue-300: #3b5ea8; --blue-400: #60a5fa; --blue-500: #60a5fa; --blue-600: #3b82f6; --blue-700: #60a5fa; --blue-800: #93c5fd; --blue-dark: #93c5fd; --blue-border: #2f4a8a;
    --violet-50: #1f1a33; --violet-200: #3d3366; --violet-400: #a78bfa; --violet-500: #a78bfa; --violet-600: #8b5cf6; --violet-700: #a78bfa;
    --purple-50: #221a2e; --purple-100: #2a1f3a; --purple-200: #43325e; --purple-700: #c084fc;
    --gray-600: #b4bac4; --gray-800: #e5e7eb;
    --teal-50: #0f2a28; --teal-700: #5eead4;
    --pink-50: #2e1426; --pink-700: #f9a8d4;
    --lime-100: #1f2a0e; --lime-800: #bef264;
    color-scheme: dark;
  }

  .kto-chip { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 5px; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); font-variant-numeric: tabular-nums; }
  .kto-einnahme { background: var(--green-light); color: var(--green); }
  .kto-gwg { background: var(--sky-100); color: var(--sky-700); }
  .kto-anlage { background: var(--violet-50); color: var(--violet-700); }
  .kto-c0 { background: var(--blue-50); color: var(--blue-700); }
  .kto-c1 { background: var(--orange-50); color: var(--orange-700); }
  .kto-c2 { background: var(--yellow-100); color: var(--yellow-800); }
  .kto-c3 { background: var(--teal-50); color: var(--teal-700); }
  .kto-c4 { background: var(--pink-50); color: var(--pink-700); }
  .kto-c5 { background: var(--lime-100); color: var(--lime-800); }
  .kto-c6 { background: var(--red-light); color: var(--red); }
  .kto-c7 { background: var(--gray-100); color: var(--gray-600); }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50); color: var(--gray-900); min-height: 100vh;
    display: flex; align-items: flex-start;
  }

  .sidebar {
    position: sticky; top: .75rem; flex-shrink: 0;
    margin: .75rem 0 .75rem .75rem;
    height: calc(100vh - 1.5rem); width: 200px;
    background: var(--surface); border: 1px solid var(--gray-200); border-radius: 16px;
    display: flex; flex-direction: column; z-index: 100; overflow: hidden;
    transition: width .22s ease;
  }
  .sidebar-logo {
    padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: .75rem;
  }
  .sidebar-logo-icon {
    width: 36px; height: 36px; background: var(--blue); border-radius: 9px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .sidebar-logo-icon svg { width: 18px; height: 18px; }
  .sidebar-logo-icon.has-img, .sidebar-logo-icon.is-pending { background: transparent; padding: 0; }
  .sidebar-logo-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; }
  .sidebar-logo-text { font-size: 1rem; font-weight: 700; transition: color .12s; }
  .sidebar-logo:hover .sidebar-logo-text { color: var(--blue); }
  .sidebar-logo-sub { font-size: .7rem; color: var(--gray-500); margin-top: 1px; }

  .sidebar-nav { padding: .75rem; flex: 1; overflow-y: auto; }
  .nav-section { margin-bottom: 1.25rem; }
  .nav-label {
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--gray-500); padding: 0 .5rem; margin-bottom: .4rem;
  }
  .nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .75rem; border-radius: 8px; font-size: .875rem;
    color: var(--gray-700); cursor: pointer; text-decoration: none;
    transition: padding .22s ease; margin-bottom: 2px;
  }
  .nav-item:hover { background: var(--gray-100); }
  .nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
  .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

  .sidebar-footer { padding: .5rem .75rem .75rem; border-top: 1px solid var(--gray-200); }

  .update-btn {
    display: flex; align-items: center; gap: .65rem;
    padding: .45rem .75rem; border-radius: 8px; font-size: .8rem;
    color: var(--gray-500); cursor: pointer; margin-bottom: 4px;
    transition: background .12s, color .12s;
  }
  .update-btn:hover { background: var(--gray-100); color: var(--gray-700); }
  .update-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
  .update-btn.updating svg { animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .user-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .6rem; border-radius: 8px; cursor: pointer;
    transition: background .12s;
  }
  .user-row:hover { background: var(--gray-100); }
  .avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--blue);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0;
  }
  .user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
  .user-name { font-size: .875rem; font-weight: 600; }

  .main { flex: 1; min-width: 0; margin-left: .5rem; padding: 2rem 2rem; min-height: 100vh; }

  .page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.75rem;
  }
  .page-header h1 { font-size: 1.5rem; font-weight: 700; }
  .page-header p { color: var(--gray-500); font-size: .875rem; margin-top: .2rem; }

  .btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .6rem 1.1rem; border-radius: 8px; font-size: .875rem;
    font-weight: 600; cursor: pointer; border: none; transition: background .15s;
    text-decoration: none; font-family: inherit;
  }
  .btn-primary { background: var(--blue); color: white; }
  .btn-primary:hover { background: #1648c0; }
  [data-theme="dark"] .btn-primary:hover { background: #3d6cd6; }
  .btn-ghost { background: var(--surface); color: var(--gray-700); border: 1px solid var(--gray-200); }
  .btn-ghost:hover { background: var(--gray-100); }
  .btn-danger { background: var(--red-light); color: var(--red); border: 1px solid var(--red-border); }
  [data-theme="dark"] .btn-danger { border-color: var(--red-light); }
  .btn-danger:hover { background: var(--red-light); }
  [data-theme="dark"] .btn-danger:hover { background: #6b2020; }
  .btn.is-disabled { opacity: .45; cursor: not-allowed; }
  .required-hint { font-size: .8rem; font-weight: 600; color: var(--red); }
  .btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .card { background: var(--surface); border-radius: 14px; border: 1px solid var(--gray-200); overflow: hidden; }
  .card-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
  }
  .card-title { font-size: .875rem; font-weight: 700; }
  .card-link { font-size: .8rem; color: var(--blue); cursor: pointer; text-decoration: none; }

  table { width: 100%; border-collapse: collapse; }
  th {
    text-align: left; padding: .65rem 1.25rem; font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500);
    background: var(--gray-50); border-bottom: 1px solid var(--gray-100); white-space: nowrap;
  }
  td { padding: .8rem 1.25rem; font-size: .875rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tbody tr { cursor: pointer; transition: background .1s; }
  tbody tr:hover td { background: var(--gray-50); }

  .badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 600; }
  .badge-blue { background: var(--blue-light); color: var(--blue); }
  .badge-green { background: var(--green-light); color: var(--green); }
  .badge-orange { background: var(--orange-light); color: var(--orange); }
  .badge-gray { background: var(--gray-100); color: var(--gray-500); }
  .badge-red { background: var(--red-light); color: var(--red); }
  .badges { display: flex; gap: .3rem; flex-wrap: wrap; }

  .empty-state { padding: 4rem 1.5rem; text-align: center; color: var(--gray-500); }
  .empty-state svg { width: 44px; height: 44px; stroke: var(--gray-300); fill: none; stroke-width: 1.5; margin-bottom: .75rem; display: block; margin-inline: auto; }
  .empty-state p { font-size: .875rem; }

  .filter-bar { display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
  .search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
  .search-wrap svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--gray-500); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
  .search-input { width: 100%; padding: .55rem .9rem .55rem 2.25rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .875rem; outline: none; background: var(--surface); color: var(--gray-900); transition: border-color .15s; font-family: inherit; }
  .search-input:focus { border-color: var(--blue); }
  .filter-tabs { display: flex; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
  .filter-tab { padding: .5rem .9rem; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--gray-500); border: none; background: none; transition: background .12s, color .12s; font-family: inherit; }
  .filter-tab.active { background: var(--blue-light); color: var(--blue); }

  .overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; }
  .overlay.open { display: flex; }
  .modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
  .modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: 16px 16px 0 0; }
  .modal-header h2 { font-size: 1rem; font-weight: 700; }
  .modal-close { width: 30px; height: 30px; border: none; background: var(--gray-100); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--gray-500); transition: background .12s; font-family: inherit; }
  .modal-close:hover { background: var(--gray-200); }
  .modal-body { padding: 1.5rem; }
  .modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; gap: .75rem; background: var(--surface); border-radius: 0 0 16px 16px; }
  .modal-footer-right { display: flex; gap: .5rem; }

  .form-section { margin-bottom: 1.5rem; }
  .form-section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--gray-100); }
  .form-row { display: grid; gap: .75rem; margin-bottom: .75rem; }
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 2fr 1fr 1.2fr; }
  .form-row.cols-addr { grid-template-columns: 2fr 1fr; }
  .field label { display: block; font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .35rem; }
  .field input, .field textarea, .field select {
    width: 100%; padding: .6rem .85rem; border: 1.5px solid var(--gray-200); border-radius: 8px;
    font-size: .875rem; color: var(--gray-900); outline: none; transition: border-color .15s; font-family: inherit;
    box-sizing: border-box; line-height: 1.4; height: 2.6rem;
    background: var(--surface);
  }
  .field select { appearance: auto; cursor: pointer; }
  .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); }
  .field textarea { height: auto; resize: vertical; min-height: 70px; }

  .bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--gray-200);
    z-index: 150;
    padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
  }
  .bn-items { display: flex; align-items: center; }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .18rem;
    padding: .35rem .25rem; font-size: .6rem; font-weight: 600; color: var(--gray-400);
    cursor: pointer; text-decoration: none; border: none; background: none;
    font-family: inherit; transition: color .12s; letter-spacing: .01em;
  }
  .bn-item.active { color: var(--blue); }
  .bn-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bn-scanner-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .18rem; padding: .35rem .25rem; font-size: .6rem; font-weight: 600; color: var(--gray-400); text-decoration: none; }
  .bn-scanner-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--blue); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(26,86,219,.38); margin-top: -10px;
    transition: transform .12s, box-shadow .12s;
  }
  .bn-scanner-btn:active { transform: scale(.93); box-shadow: 0 2px 8px rgba(26,86,219,.3); }
  .bn-scanner-btn svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .mehr-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300;
  }
  .mehr-overlay.open { display: block; }
  .mehr-sheet {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
    border-radius: 22px 22px 0 0; z-index: 301;
    max-height: 82vh; overflow-y: auto;
    transform: translateY(100%); visibility: hidden; transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s linear .26s;
    padding: .75rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  }
  .mehr-sheet.open { transform: translateY(0); visibility: visible; transition: transform .26s cubic-bezier(.32,.72,0,1), visibility 0s; }
  .mehr-handle {
    width: 38px; height: 4px; border-radius: 2px; background: var(--gray-200);
    margin: 0 auto .9rem;
  }
  .mehr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .75rem; }
  .mehr-item {
    display: flex; align-items: center; gap: .6rem; padding: .75rem .85rem;
    border-radius: 11px; font-size: .875rem; font-weight: 600;
    color: var(--gray-700); cursor: pointer; text-decoration: none;
    background: var(--gray-50); transition: background .12s;
  }
  .mehr-item:active { background: var(--gray-200); }
  .mehr-item.active { background: var(--blue-light); color: var(--blue); }
  .mehr-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .mehr-item[hidden] { display: none; }
  .mehr-update { color: var(--blue); background: var(--blue-light); }
  .mehr-update.updating svg { animation: spin 1s linear infinite; }
  .mehr-divider { height: 1px; background: var(--gray-100); margin: .5rem 0; }
  .mehr-user {
    display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
    border-radius: 11px; background: var(--gray-50); cursor: pointer; transition: background .12s;
  }
  .mehr-user:active { background: var(--gray-200); }
  .mehr-user .avatar { flex-shrink: 0; }
  .mehr-user-info { flex: 1; }
  .mehr-username { font-size: .875rem; font-weight: 700; }
  .mehr-logout-label { font-size: .7rem; color: var(--gray-500); margin-top: .1rem; }

  .nav-text { overflow: hidden; white-space: nowrap; max-width: 160px; }
  .bug-btn > span, .update-btn > span { overflow: hidden; white-space: nowrap; max-width: 120px; }
  .bug-btn, .update-btn { transition: background .12s, color .12s; }

  .expand-btn {
    background: none; border: none; cursor: pointer; padding: .25rem;
    color: var(--gray-400); display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: color .12s, background .12s;
  }
  .expand-btn:hover { background: var(--gray-100); color: var(--gray-700); }
  .expand-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5;
    stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
  .expand-btn.open svg { transform: rotate(90deg); }
  .eq-section > td { padding: 0 !important; border-bottom: 1px solid var(--gray-100) !important; }
  .eq-section:hover > td { background: transparent; }
  .eq-wrap { background: var(--gray-50); border-top: 1px solid var(--gray-100); }
  .eq-inner { padding: .9rem 1.25rem 1.1rem 3.25rem; }
  .eq-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .7rem; }
  .eq-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); }
  .group-heading-row td { padding: 0; border: none; background: transparent; }
  .group-heading-invoice { padding: .7rem 1rem .35rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--blue); border-bottom: 2px solid var(--blue); margin-bottom: .1rem; }
  .group-heading-itemcat { padding: .5rem 1rem .3rem 1.5rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); border-bottom: 1px solid var(--gray-100); }
  .eq-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .8rem; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
  .eq-table th { text-align: left; padding: .5rem .9rem; font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
  .eq-table td { padding: .6rem .9rem; font-size: .8rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
  .eq-table tbody tr:last-child td { border-bottom: none; }
  .eq-table tbody tr:hover td { background: var(--blue-50, var(--gray-50)); }
  .eq-empty { color: var(--gray-400); font-size: .8rem; padding: .5rem 0; }
  .ar-num { font-size: .8rem; color: var(--gray-500); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
  .eq-num { font-size: .75rem; color: var(--gray-500); font-weight: 600; white-space: nowrap; }
  .price-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .mat-wrap { display: flex; gap: 1.25rem; align-items: flex-start; }
  .mat-nav { width: 200px; flex-shrink: 0; background:var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; padding: .75rem; align-self: flex-start; position: sticky; top: 2rem; }
  .mat-nav-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); padding: .25rem .5rem; margin-bottom: .25rem; }
  .mat-nav-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-radius: 7px; font-size: .875rem; color: var(--gray-700); cursor: pointer; transition: background .12s, color .12s; margin-bottom: 2px; text-decoration: none; }
  .mat-nav-item:hover { background: var(--gray-100); }
  .mat-nav-item[hidden] { display: none; }
  .mat-nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
  .mat-nav-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .mat-content { flex: 1; min-width: 0; }
  .mat-section { display: none; }
  .mat-section.active { display: block; }
  .eq-count { display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 .4rem;
    background: var(--gray-100); color: var(--gray-600); border-radius: 99px;
    font-size: .7rem; font-weight: 700; }
  .eq-count.has { background: var(--blue-light); color: var(--blue); }
  .eq-defect-badge { display:inline-flex;align-items:center;gap:.3rem;font-size:.7rem;font-weight:700;background:var(--amber-100);color:var(--amber-800);border-radius:99px;padding:0 .5rem;height:20px;white-space:nowrap; }
  .defect-card { background:var(--surface);border:1px solid var(--gray-200);border-radius:12px;padding:1rem 1.25rem;margin-bottom:.75rem; }
  .defect-card-top { display:flex;align-items:flex-start;gap:.75rem; }
  .defect-badge { background:var(--amber-100);color:var(--amber-800);border-radius:6px;padding:.2rem .55rem;font-size:.7rem;font-weight:700;white-space:nowrap;flex-shrink:0; }
  .eq-ctx-menu { position:fixed;z-index:9999;background:var(--surface);border:1px solid var(--gray-200);border-radius:9px;box-shadow:0 4px 16px rgba(0,0,0,.12);padding:.4rem;min-width:195px;display:none; }
  .ar-search-wrap { position: relative; }
  .ar-search-wrap input { width: 100%; padding: .6rem .85rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .875rem; outline: none; transition: border-color .15s; font-family: inherit; }
  .ar-search-wrap input:focus { border-color: var(--blue); }
  .ar-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background:var(--surface); border: 1.5px solid var(--gray-200); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 50; max-height: 220px; overflow-y: auto; display: none; }
  .ar-dropdown.open { display: block; }
  .ar-option { padding: .6rem .85rem; cursor: pointer; font-size: .875rem; transition: background .1s; }
  .ar-option:hover { background: var(--gray-50); }
  .ar-option-num { font-size: .7rem; color: var(--gray-500); margin-right: .4rem; font-weight: 600; }
  .ar-selected { display: none; background: var(--blue-light); border: 1.5px solid var(--blue-border); border-radius: 8px; padding: .6rem .85rem; margin-top: .5rem; font-size: .875rem; align-items: center; justify-content: space-between; }
  .ar-selected.show { display: flex; }
  .ar-selected-name { font-weight: 600; }
  .ar-selected-clear { background: none; border: none; cursor: pointer; color: var(--blue); font-size: 1rem; padding: 0 .25rem; }
  .eq-fields { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-100); display: none; }
  .eq-fields.show { display: block; }
  .save-indicator { font-size: .8rem; color: var(--green); font-weight: 600; opacity: 0; transition: opacity .3s; }
  .btn-packen { background: var(--green); color: white; }
  .btn-packen:hover { background: var(--green); }
  .btn-fertig  { background: var(--orange-600); color: white; }
  .btn-fertig:hover  { background: var(--orange-700); }
  .btn-packen:disabled, .btn-fertig:disabled { opacity: .6; cursor: not-allowed; }
  .status-cell { position: relative; }
  .status-cell .badge { cursor: pointer; user-select: none; }
  .status-cell .badge:hover { opacity: .85; }
  .status-dd {
    position: fixed; z-index: 9999;
    background:var(--surface); border: 1.5px solid var(--gray-200); border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12); min-width: 150px; overflow: hidden; display: none;
  }
  .status-dd.open { display: block; }
  .anlage-header { position: sticky; top: 0; z-index: 20; background:var(--surface); border-bottom: 1px solid var(--gray-200); padding: .85rem 1.5rem; display: flex; align-items: center; gap: .75rem; }
  .anlage-header-back { background: none; border: none; cursor: pointer; color: var(--gray-500); display: flex; align-items: center; gap: .35rem; font-size: .875rem; padding: .3rem .5rem; border-radius: 6px; transition: color .12s, background .12s; }
  .anlage-header-back:hover { background: var(--gray-100); color: var(--gray-800); }
  .anlage-header-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .anlage-num-badge { font-size: .8rem; font-weight: 700; background: var(--blue-light); color: var(--blue); padding: .2rem .55rem; border-radius: 6px; letter-spacing: .03em; }
  .anlage-header-title { font-size: 1rem; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .anlage-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-200); padding: 0 1.5rem; background:var(--surface); }
  .anlage-tab { padding: .7rem 1rem; font-size: .875rem; font-weight: 500; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .15s; white-space: nowrap; }
  .anlage-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
  .anlage-body { padding: 1.5rem; max-width: 760px; }
  .anlage-panel { display: none; }
  .anlage-panel.active { display: block; }
  .bk-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 1rem; }
  .bk-table th { text-align: left; padding: .5rem .75rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); border-bottom: 2px solid var(--gray-100); }
  .bk-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
  .bk-table tr:last-child td { border-bottom: none; }
  .qty-input { width: 70px; padding: .35rem .5rem; border: 1.5px solid var(--gray-200); border-radius: 6px; font-size: .875rem; text-align: right; font-family: inherit; }
  .qty-input:focus { outline: none; border-color: var(--blue); }
  .remove-btn { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: .25rem; border-radius: 4px; display: flex; transition: color .12s; }
  .remove-btn:hover { color: var(--red); }
  .remove-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .name-cell { font-weight: 600; }
  .name-sub { font-size: .8rem; color: var(--gray-500); margin-top: 1px; }
  .type-row { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
  .type-check { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border: 2px solid var(--gray-200); border-radius: 10px; cursor: pointer; transition: all .15s; flex: 1; user-select: none; }
  .type-check:hover { border-color: var(--gray-400); }
  .type-check.checked-blue { border-color: var(--blue); background: var(--blue-light); }
  .type-check.checked-green { border-color: var(--green); background: var(--green-light); }
  .type-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .type-icon.blue { background: var(--blue-light); }
  .type-icon.green { background: var(--green-light); }
  .type-icon svg { width: 14px; height: 14px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .type-icon.blue svg { stroke: var(--blue); }
  .type-icon.green svg { stroke: var(--green); }
  .type-label { font-size: .875rem; font-weight: 600; }
  .type-sub { font-size: .7rem; color: var(--gray-500); margin-top: 1px; }
  .type-check-indicator { width: 18px; height: 18px; border: 2px solid var(--gray-300); border-radius: 4px; margin-left: auto; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
  .confirm-delete { display: none; }
  .confirm-delete.show { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--red); }
  .art-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 .4rem; background: var(--gray-100); color: var(--gray-600); border-radius: 99px; font-size: .7rem; font-weight: 700; }
  .art-count.has { background: var(--blue-light); color: var(--blue); }

  .nav-parent { cursor: pointer; }
  .nav-sub { padding-left: .75rem; }
  .nav-sub .nav-item { font-size: .8rem; padding: .4rem .85rem; }
  .nav-sub .nav-item svg { display: none; }
  .nav-sub .nav-item::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .5rem; opacity: .5; }
  .nav-sub .nav-item.active::before { opacity: 1; }
  .bug-btn { display: flex; align-items: center; gap: .55rem; padding: .45rem .85rem; border-radius: 8px; font-size: .875rem; font-weight: 600; color: var(--red); cursor: pointer; transition: background .12s; margin-bottom: 2px; background: none; border: none; width: 100%; text-align: left; }
  .bug-btn:hover { background: var(--red-light); }
  .bug-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
  .sb-report-row { display: flex; gap: 2px; }
  .sb-report-row .bug-btn { flex: 1 1 auto; width: auto; padding: .45rem .6rem; gap: .45rem; }
  .feature-btn { color: var(--green); }
  .feature-btn:hover { background: var(--green-light); }
  [data-theme="dark"] #sidebar-logo-icon img { filter: brightness(0) invert(1); }
  .version-badge { font-size: .7rem; color: var(--gray-400); padding: .2rem .5rem; margin: .25rem .25rem .35rem; cursor: pointer; border-radius: 5px; display: inline-block; transition: background .12s,color .12s; letter-spacing: .03em; }
  .version-badge:hover { background: var(--gray-100); color: var(--gray-600); }
  .changelog-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; align-items: center; justify-content: center; }
  .changelog-overlay.open { display: flex; }
  .changelog-modal { background: var(--surface); border-radius: 16px; width: 480px; max-width: 94vw; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
  .changelog-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
  .changelog-header h2 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
  .changelog-close { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: .25rem; border-radius: 6px; display: flex; align-items: center; transition: background .12s; }
  .changelog-close:hover { background: var(--gray-100); color: var(--gray-700); }
  .changelog-body { overflow-y: auto; padding: 1.25rem 1.5rem; flex: 1; }
  .changelog-entry { margin-bottom: 1.5rem; }
  .changelog-entry:last-child { margin-bottom: 0; }
  .changelog-version { font-size: .875rem; font-weight: 700; color: var(--blue); margin-bottom: .15rem; }
  .changelog-date { font-size: .75rem; color: var(--gray-400); margin-bottom: .6rem; }
  .changelog-items { list-style: none; padding: 0; }
  .changelog-items li { font-size: .875rem; color: var(--gray-700); padding: .2rem 0; padding-left: 1rem; position: relative; }
  .changelog-items li::before { content: '•'; position: absolute; left: 0; color: var(--gray-400); }

  .mchips { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; width: 100%; box-sizing: border-box; min-height: 2.6rem; padding: .25rem .4rem; border: 1.5px solid var(--gray-200); border-radius: 8px; background: var(--surface); cursor: text; }
  .mchips:focus-within { border-color: var(--blue); }
  .mchips .mchips-input { flex: 1; width: auto; height: auto; min-width: 160px; border: 0; outline: none; padding: .25rem .2rem; background: transparent; box-shadow: none; font-size: .875rem; color: var(--gray-900); font-family: inherit; }
  .mchip { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; padding: .15rem .25rem .15rem .6rem; border-radius: 99px; background: var(--blue-light); color: var(--blue); font-size: .8rem; font-weight: 600; cursor: default; user-select: none; }
  .mchip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mchip.is-invalid { background: var(--red-light); color: var(--red); }
  .mchip-del { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: .65rem; cursor: pointer; opacity: .7; }
  .mchip-del:hover { opacity: 1; background: var(--surface); }
  #eqaOverlay { z-index: 20000; }
  #eqaOverlay .modal { max-width: 480px; }
  .eqa-info { font-size: .8rem; color: var(--gray-500); margin-bottom: 1rem; padding: .6rem .85rem; background: var(--gray-50); border-radius: 8px; }
  .eqa-info b { color: var(--gray-800); }
  .eqa-cur { display: inline-block; font-family: monospace; font-weight: 700; color: var(--blue); background: var(--blue-light); padding: .05rem .4rem; border-radius: 5px; }
  .eqa-nfc { display: inline-block; font-family: monospace; font-size: .75rem; color: var(--gray-600); background: var(--gray-100); padding: .05rem .4rem; border-radius: 5px; }
  .eqa-kind { display: flex; gap: .25rem; padding: .2rem; margin-bottom: .6rem; background: var(--gray-100); border-radius: 8px; }
  .eqa-kind button { flex: 1; padding: .4rem .6rem; border: 0; border-radius: 6px; background: none; color: var(--gray-600); font-size: .8rem; font-weight: 600; font-family: inherit; cursor: pointer; }
  .eqa-kind button:disabled { color: var(--gray-300); cursor: not-allowed; }
  .eqa-kind button.sel { background: var(--surface); color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
  .eqa-input-row { display: flex; gap: .5rem; }
  .eqa-input-row input.eqa-input-nfc, .eqa-input-row input.eqa-input-free { text-transform: none; }
  .eqa-kind[hidden] { display: none; }
  .eqa-group { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .8rem; }
  .eqa-group label { font-weight: 600; color: var(--gray-700); }
  .eqa-group select { flex: 1; min-width: 0; }
  .eqa-input-row input { flex: 1; font-family: monospace; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; padding: .65rem .85rem; border: 1.5px solid var(--gray-200); border-radius: 8px; outline: none; background: var(--surface); color: var(--gray-800); }
  .eqa-input-row input:focus { border-color: var(--blue); }
  .eqa-cam-btn { flex-shrink: 0; width: 44px; border: 1.5px solid var(--gray-200); border-radius: 8px; background: var(--surface); color: var(--gray-600); cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .eqa-cam-btn[hidden] { display: none; }
  .eqa-cam-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
  .eqa-cam-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .eqa-hint { font-size: .75rem; color: var(--gray-400); margin-top: .35rem; }
  .eqa-video-wrap { display: none; margin-top: .75rem; border-radius: 10px; overflow: hidden; background: #000; position: relative; aspect-ratio: 4/3; }
  .eqa-video-wrap.open { display: block; }
  .eqa-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
  .eqa-video-frame { position: absolute; inset: 22% 22%; border: 2px solid rgba(255,255,255,.85); border-radius: 10px; pointer-events: none; }
  .eqa-msg { font-size: .8rem; margin-top: .6rem; min-height: 1.1em; }
  .eqa-msg.err { color: var(--red); }
  .eqa-msg.ok { color: var(--green); }
  .eqa-reason { margin-top: 1rem; }
  .eqa-reason label { display: block; font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .35rem; }
  .eqa-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
  .eqa-chip { padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--gray-200); background: var(--surface); color: var(--gray-600); font-family: inherit; }
  .eqa-chip.sel { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
  .eqa-reason input { width: 100%; padding: .5rem .75rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .875rem; outline: none; background: var(--surface); color: var(--gray-800); font-family: inherit; box-sizing: border-box; }
  .eqa-progress { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--gray-500); margin: 1rem 0 .4rem; }
  .eqa-progress b { color: var(--gray-800); }
  .eqa-bar { height: 5px; border-radius: 99px; background: var(--gray-100); overflow: hidden; margin-bottom: .75rem; }
  .eqa-bar div { height: 100%; background: var(--green); transition: width .2s; }
  .eqa-list { display: flex; flex-direction: column; gap: .3rem; max-height: 260px; overflow-y: auto; }
  .eqa-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border: 1.5px solid var(--gray-100); border-radius: 8px; font-size: .8rem; cursor: pointer; }
  .eqa-item.target { border-color: var(--blue); background: var(--blue-light); }
  .eqa-item.done { cursor: default; opacity: .85; }
  .eqa-item-idx { font-size: .7rem; color: var(--gray-400); min-width: 1.6rem; }
  .eqa-item-main { flex: 1; min-width: 0; color: var(--gray-700); }
  .eqa-item-sub { font-size: .7rem; color: var(--gray-400); }
  .eqa-item-num { font-family: monospace; font-weight: 700; color: var(--green); }
  .eqa-item-pending { font-size: .75rem; color: var(--gray-400); }
  .eqa-item.target .eqa-item-pending { color: var(--blue); font-weight: 600; }

  .ac-drop { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 99999; background: #fff; border: 1.5px solid var(--gray-300); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 220px; overflow-y: auto; }
  .ac-item { padding: .45rem .75rem; font-size: .875rem; cursor: pointer; color: var(--gray-700); }
  .ac-item:hover { background: var(--blue-50); color: var(--blue-700); }

  @keyframes ws-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
  .ws-upd { position: fixed; top: 1rem; right: 1rem; z-index: 99999; background: #1e293b; color: #f8fafc; border-radius: 12px; padding: .65rem 1rem; box-shadow: 0 4px 24px rgba(0,0,0,.45); display: flex; align-items: center; gap: .7rem; font-size: .8rem; font-family: inherit; user-select: none; line-height: 1.35; }
  .ws-upd.is-passive { pointer-events: none; }
  .ws-upd.is-now { background: #7f1d1d; }
  .ws-upd-dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; animation: ws-pulse 1s ease-in-out infinite; }
  .ws-upd.is-now .ws-upd-dot { background: #ef4444; animation-duration: .6s; }
  .ws-upd-title { font-weight: 700; margin-bottom: .1rem; }
  .ws-upd-text { color: #94a3b8; font-size: .75rem; }
  .ws-upd.is-now .ws-upd-text { color: #fca5a5; }
  .ws-upd-btn { margin-top: .45rem; padding: .3rem .7rem; border-radius: 6px; border: none; cursor: pointer; background: #22c55e; color: #fff; font-size: .75rem; font-weight: 700; font-family: inherit; }
  .ws-upd-btn.is-waiting { background: #64748b; cursor: default; }

  .show-sm { display: none; }
  @media (max-width: 767px) {
    table.mtable, table.mtable > tbody { display: block; width: 100%; }
    table.mtable > thead { display: none; }
    table.mtable > tbody > tr { display: grid; gap: .3rem .75rem; align-items: center; padding: .7rem .85rem; border-bottom: 1px solid var(--gray-200); }
    table.mtable > tbody > tr:not(.month-sep):not(.heute-sep):not(.mt-full) > td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; background: transparent !important; width: auto !important; max-width: none !important; }
    table.mtable > tbody > tr > td:empty { display: none; }
    table.mtable > tbody > tr.month-sep, table.mtable > tbody > tr.heute-sep, table.mtable > tbody > tr.mt-full { display: block; padding: 0; border-bottom: 0; }
    table.mtable > tbody > tr.month-sep > td, table.mtable > tbody > tr.heute-sep > td, table.mtable > tbody > tr.mt-full > td { display: block; position: relative; }
  }
  @media (max-width: 1200px) { .hide-lg { display: none !important; } }
  @media (max-width: 1024px) { .hide-md { display: none !important; } }

  @media (max-width: 1024px) {
    .mat-wrap, .settings-wrap, .stat-layout { flex-direction: column !important; align-items: stretch !important; gap: .75rem !important; }
    .mat-nav, .settings-nav, .stat-nav {
      width: auto !important; position: static !important; align-self: stretch !important;
      display: flex; flex-wrap: nowrap; align-items: center; gap: .25rem;
      overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
      padding: .35rem !important; margin: 0;
    }
    .mat-nav::-webkit-scrollbar, .settings-nav::-webkit-scrollbar, .stat-nav::-webkit-scrollbar { display: none; }
    .mat-nav-label, .settings-nav-label, .stat-nav-label { display: none; }
    .mat-nav-item, .settings-nav-item, .stat-nav-item {
      flex: 0 0 auto; margin: 0; white-space: nowrap; padding: .5rem .8rem !important; font-size: .875rem !important;
      justify-content: center; gap: .45rem; min-width: 0;
    }
    .settings-content { padding-left: 0 !important; }
    .stat-content { overflow: visible !important; min-width: 0; }
  }

  @media (max-width: 767px) {
    body { display: block; }
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea, [contenteditable="true"] { font-size: 16px !important; }
    .sidebar { display: none !important; }
    .main { margin-left: 0 !important; padding: 1rem 1rem calc(env(safe-area-inset-bottom) + 72px) 1rem !important; }
    .bottom-nav { display: block; }
    .in-mapp .bottom-nav, .in-mapp .mehr-sheet, .in-mapp .mehr-overlay { display: none !important; }
    .in-mapp .main { padding-bottom: 1.5rem !important; }

    .page-header { flex-direction: column; gap: .75rem; align-items: flex-start; }
    .page-header h1 { font-size: 1.25rem; }

    .filter-bar { flex-wrap: wrap; gap: .5rem; }
    .search-wrap { flex: 1 1 100%; min-width: 0; max-width: none; }
    .filter-tabs { flex: 1 1 100%; min-width: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .filter-tab { flex-shrink: 0; }
    .filter-tabs::-webkit-scrollbar { display: none; }

    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
    .eq-inner { padding: .6rem .6rem; overflow-x: auto; }
    .defect-card { padding: .85rem; }
    .defect-card-top { flex-wrap: wrap; }
    .defect-card-top > .flex-1 { flex: 1 1 100% !important; order: 2; min-width: 0; }
    .defect-card-top > .btn, .defect-card-top > span:last-child { order: 3; }
    .hide-sm { display: none !important; }
    .tbl-tight th, .tbl-tight td { padding-left: .45rem !important; padding-right: .45rem !important; }
    .tbl-tight th { white-space: normal; }
    .show-sm { display: block; }
    .form-row.cols-2,
    .form-row.cols-3,
    .form-row.cols-addr { grid-template-columns: 1fr !important; }

    .card { overflow-x: auto; }


    .anlage-header { flex-wrap: wrap; padding: .6rem .75rem; gap: .4rem .5rem; }
    .anlage-header-title { order: 10; flex: 1 1 100%; white-space: normal; overflow: visible; font-size: .95rem; line-height: 1.3; }
    .anlage-header-actions { gap: .35rem; }
    .anlage-header-actions .btn { padding: .45rem .7rem; }
    .anlage-tabs { overflow-x: auto; padding: 0 .5rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .anlage-tabs::-webkit-scrollbar { display: none; }
    .anlage-tab { padding: .65rem .75rem; }
    .anlage-body { padding: 1rem .75rem; max-width: none; }
    .main.p-0 { padding: 0 0 calc(env(safe-area-inset-bottom) + 72px) 0 !important; }

    .overlay { padding: 0; align-items: flex-end; }
    .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
    .modal-header { border-radius: 22px 22px 0 0; }
  }
  .img-up { display: flex; gap: 1rem; align-items: stretch; }
  .img-up-preview { width: 140px; height: 140px; flex-shrink: 0; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .img-up-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
  .img-up-preview.is-empty span { font-size: .8rem; color: var(--gray-400); }
  .img-up-side { flex: 1; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
  .img-up-drop { flex: 1; min-height: 80px; border: 2px dashed var(--gray-200); border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; padding: .75rem; font-size: .8rem; color: var(--gray-400); cursor: pointer; transition: border-color .12s, color .12s; }
  .img-up-drop:hover, .img-up-drop.is-over { border-color: var(--blue); color: var(--blue); }
  .img-up-drop.is-disabled { cursor: default; }
  .img-up-drop.is-disabled:hover { border-color: var(--gray-200); color: var(--gray-400); }
  .img-up-remove { align-self: flex-start; }
  .img-up .is-hidden-input { display: none; }
  [data-img] { text-decoration: underline dotted var(--gray-300); text-underline-offset: 3px; }
  .img-hover-pop { position: fixed; left: var(--pop-x, 0); top: var(--pop-y, 0); z-index: 10000; width: 260px; height: 260px; padding: 6px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: none; pointer-events: none; }
  .img-hover-pop.is-open { display: flex; align-items: center; justify-content: center; }
  .img-hover-pop img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

  .drop-dash { border: 2px dashed var(--gray-300); transition: border-color .15s, background .15s; }
  .drop-dash-fill { background: var(--gray-50); }
  .drop-dash.is-over { border-color: var(--blue); }
  .drop-dash-hl.is-over { background: var(--blue-light); }

  .pack-flow { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; padding: .9rem 1rem .8rem; margin-bottom: 1rem; }
  .pack-flow.is-zurueck { background: var(--green-light); border-color: var(--green-border); }
  .pack-steps { --pack-w: 7.5rem; display: flex; align-items: flex-start; }
  @media (max-width: 480px) { .pack-steps { --pack-w: 5.6rem; } }
  .pack-step { flex: 0 0 auto; width: var(--pack-w); display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
  .pack-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gray-100); border: 2px solid var(--gray-200); transition: background .3s, border-color .3s; }
  .pack-dot svg { width: 17px; height: 17px; fill: none; stroke: var(--gray-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pack-step-t { font-size: .8rem; font-weight: 600; color: var(--gray-500); }
  .pack-step-d { font-size: .7rem; color: var(--gray-500); min-height: 1em; }
  .pack-step.is-active .pack-dot { background: var(--blue-light); border-color: var(--blue); }
  .pack-step.is-active .pack-dot svg { stroke: var(--blue); }
  .pack-step.is-active .pack-step-t { color: var(--gray-900); font-weight: 700; }
  .is-unterwegs .pack-step.is-active .pack-dot, .is-rueckkehr .pack-step.is-active .pack-dot { background: var(--orange-light); border-color: var(--orange); animation: pack-pulse 2s ease-in-out infinite; }
  .is-unterwegs .pack-step.is-active .pack-dot svg, .is-rueckkehr .pack-step.is-active .pack-dot svg { stroke: var(--orange); }
  .pack-step.is-done .pack-dot { background: var(--green); border-color: var(--green); }
  .pack-step.is-done .pack-dot svg { stroke: var(--surface); }
  .pack-step.is-done .pack-step-t { color: var(--gray-700); }
  .pack-line { flex: 1; height: 4px; margin: 15px calc(19px - var(--pack-w) / 2) 0; border-radius: 2px; background: var(--gray-100); overflow: hidden; }
  .pack-line-fill { height: 100%; border-radius: 2px; background: var(--blue); transition: width .4s; }
  .pack-line.is-rueck .pack-line-fill, .is-unterwegs .pack-line.is-hin .pack-line-fill, .is-rueckkehr .pack-line.is-hin .pack-line-fill, .is-zurueck .pack-line-fill { background: var(--green); }
  .pack-msg { margin-top: .6rem; font-size: .8rem; color: var(--gray-700); text-align: center; }
  @keyframes pack-pulse { 50% { box-shadow: 0 0 0 5px var(--orange-light); } }
  @media (prefers-reduced-motion: reduce) { .pack-dot { animation: none !important; } }
  .lock-tip { position: fixed; z-index: 10000; max-width: min(22rem, calc(100vw - 16px)); padding: .5rem .7rem; border-radius: 8px; background: var(--gray-900); color: var(--gray-50); font-size: .78rem; font-weight: 500; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.22); pointer-events: none; animation: lock-tip-in .12s ease-out; }
  @keyframes lock-tip-in { from { opacity: 0; transform: translateY(-3px); } }
  .lock-tip.is-above { animation-name: lock-tip-in-up; }
  @keyframes lock-tip-in-up { from { opacity: 0; transform: translateY(3px); } }
}
