/* =====================================================
   HARIX – Design wie das harixumzug-Kundenportal (assets/portal.css im Plugin)
   Nach harix-modern-theme.css laden. Nur Aussehen, keine Logik.
   „html body“ davor, weil harix-ui-shell.js sein CSS erst zur Laufzeit anhängt.
   Farben: Blau #0C31A6 / #0A2785 / #071a5c, Cyan #00B4F5, Schrift #111827, Grau #5b6475, Linie #dfe5ef
   ===================================================== */
html:root {
  --navy: #071a5c;
  --dark: #111827;
  --surface: #f4f6fb;
  --surface-2: #eef2f8;
  --border: #e6ebf4;
  --border-2: #dfe5ef;
  --blue: #0C31A6;
  --blue-hover: #0A2785;
  --blue-soft: #e0e8ff;
  --blue-50: #eef2ff;
  --cyan: #00B4F5;
  --gray-50: #f8fafd;
  --gray-100: #f3f6fb;
  --gray-200: #e6ebf4;
  --gray-300: #d5dcea;
  --gray-400: #9aa6bd;
  --gray-500: #5b6475;
  --gray-600: #4b5567;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow: 0 10px 28px rgba(12, 49, 166, .06);
  --shadow-md: 0 12px 30px rgba(12, 49, 166, .08);
  --shadow-lg: 0 24px 60px rgba(7, 26, 92, .18);
  --hx-grad: linear-gradient(135deg, #0C31A6, #2a5cff);
  --hx-ring: 0 0 0 4px rgba(0, 180, 245, .18);
}
html body { background: #f4f6fb; }
html body .app-body { background: linear-gradient(180deg, #eef2f8 0, #f4f6fb 320px); }

/* ---------- Kopfzeile: blaues Band wie oben im Portal ---------- */
html body .app-header {
  background: #0a2785 !important;
  color: #fff !important;
  border-bottom: 0;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
}
/* Statt Schriftzug: neues Logo (am PC steht es in der Seitenleiste) */
html body .app-header > div:first-of-type { width: 132px; height: 34px; background: url(app-icons/logo-gmbh-negativ.svg) left center / contain no-repeat; }
html body .app-header > div:first-of-type > * { display: none; }
html body.hx-desk .app-header > div:first-of-type { visibility: hidden; }
html body .header-btn { color: rgba(255, 255, 255, .88); border-radius: 12px; }
html body .header-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
html body .user-badge { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff; }

/* ---------- Seitenleiste (PC): dunkelblau wie die Markenfläche im Portal ---------- */
html body .hx-side {
  background: radial-gradient(420px 300px at 110% -5%, rgba(0, 180, 245, .35), transparent 60%), linear-gradient(170deg, #0C31A6 0%, #0A2785 45%, #071a5c 100%);
  border-right: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
html body .hx-side .hx-brand { padding: 6px 8px 18px !important; }
html body .hx-search { background: #fff; border: 1.5px solid #dfe5ef; border-radius: 12px; color: #5b6475; padding: 9px 12px; }
html body .hx-search input { color: #111827; }
html body .hx-side .hx-search { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .7); padding: 8px 11px; }
html body .hx-side .hx-search input { color: #fff; }
html body .hx-side .hx-search input::placeholder { color: rgba(255, 255, 255, .6); }
html body .hx-group { color: rgba(255, 255, 255, .55); }
html body .hx-item { color: rgba(255, 255, 255, .85); border-radius: 11px; padding: 8px 10px; transition: background .15s, color .15s; }
html body .hx-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
html body .hx-item.active { background: #fff; color: #0C31A6; box-shadow: 0 8px 18px rgba(7, 26, 92, .3); }
html body .hx-item small { color: rgba(255, 255, 255, .55); }
html body .hx-item.active small { color: #5b6475; }
html body .hx-badge { background: #e11d48; color: #fff; }
html body .hx-badge.soft { background: #00B4F5; color: #032053; }
html body .hx-user { border-top: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .7); }

/* ---------- Karten ---------- */
html body .card, html body .vehicle-card, html body .order-card, html body .stop-card, html body .kpi-card, html body .hx-kpi, html body .hx-day, html body .hx-tile {
  border: 1px solid #e6ebf4;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(12, 49, 166, .06);
}
html body .card { padding: 18px 20px; }
html body .card:hover { border-color: #e6ebf4; }
html body .hx-kpi, html body .hx-tile, html body .hx-day { transition: transform .2s, box-shadow .2s, border-color .2s; }
html body .hx-kpi:hover, html body .hx-tile:hover, html body .hx-day:hover, html body .vehicle-card:hover, html body .order-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(12, 49, 166, .14);
  border-color: #c9d6f2;
}
html body .hx-kpi { padding: 16px 18px; }
html body .hx-kpi .v, html body .kpi-card .kpi-value { color: #111827; }
html body .hx-kpi .l, html body .kpi-card .kpi-label { color: #5b6475; }
html body .hx-todo:hover { background: #f3f6fb; }
html body .hx-todo .go { color: #0C31A6; }
html body .hx-dot { border-radius: 12px; }
html body .hx-day.today { border-color: #0C31A6; box-shadow: inset 0 0 0 1px #0C31A6, 0 10px 22px rgba(12, 49, 166, .14); }
html body .info-cell { background: #f3f6fb; border: 0; border-radius: 16px; }
html body .tour-meta-strip { background: #f3f6fb; border: 0; border-radius: 16px; }
html body .maint-row { border-radius: 14px; }
html body .page-title { font-weight: 800; letter-spacing: -.02em; color: #111827; }
html body .page-subtitle { color: #5b6475; }
html body .section-header, html body .hx-moregrp { color: #5b6475; }

/* ---------- Knöpfe ---------- */
html body .btn { border-radius: 12px; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
html body .btn:active:not(:disabled) { transform: translateY(1px); }
html body .btn:focus-visible { outline: none; box-shadow: var(--hx-ring); }
html body .btn-primary { background: var(--hx-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(12, 49, 166, .28); }
html body .btn-primary:hover { background: linear-gradient(135deg, #0A2785, #0C31A6); box-shadow: 0 12px 26px rgba(12, 49, 166, .35); }
html body .btn-outline { background: #fff; color: #0C31A6; border: 1.5px solid #dfe5ef; }
html body .btn-outline:hover { background: rgba(12, 49, 166, .05); border-color: #c9d6f2; }
html body .action-btn { border-radius: 12px; border: 1.5px solid #dfe5ef; }
html body .hx-actions button { border: 1.5px solid #dfe5ef; border-radius: 12px; color: #0C31A6; font-weight: 700; transition: transform .15s, box-shadow .15s, border-color .15s; }
html body .hx-actions button:hover { border-color: #c9d6f2; color: #0C31A6; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(12, 49, 166, .12); }
html body .hx-actions button.primary { background: var(--hx-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(12, 49, 166, .28); }
html body .fab, html body .chat-send { background: var(--hx-grad); box-shadow: 0 10px 22px rgba(12, 49, 166, .35); }

/* ---------- Eingabefelder ---------- */
html body .form-label { font-size: 12.5px; font-weight: 600; color: #374151; text-transform: none; letter-spacing: 0; }
html body .form-input, html body .form-select, html body .form-textarea { border: 1.5px solid #dfe5ef; border-radius: 12px; color: #111827; }
html body .form-input:focus, html body .form-select:focus, html body .form-textarea:focus { outline: none; border-color: #0C31A6; box-shadow: var(--hx-ring); }
html body input[type="checkbox"], html body input[type="radio"] { accent-color: #0C31A6; }

/* ---------- Reiter ---------- */
html body .tabs { background: #fff; border: 1px solid #e6ebf4; border-radius: 16px; padding: 4px; }
html body .app-body .tabs { background: #fff; border: 1px solid #e6ebf4; border-radius: 14px; padding: 4px; }
html body .app-body .tabs .tab { border-radius: 10px; color: #5b6475; font-weight: 700; transition: background .2s, color .2s; }
html body .app-body .tabs .tab:hover { background: #f3f6fb; color: #0C31A6; }
html body .tab.active, html body .app-body .tabs .tab.active { background: var(--hx-grad); color: #fff; box-shadow: 0 8px 18px rgba(12, 49, 166, .25); }
html body .app-body .tabs.tabs-line { background: none; border: 0; border-bottom: 1px solid #e6ebf4; border-radius: 0; padding: 0; }
html body .app-body .tabs.tabs-line .tab { border-radius: 0; }
html body .app-body .tabs.tabs-line .tab:hover { background: none; color: #0C31A6; }
html body .app-body .tabs.tabs-line .tab.active { background: none; color: #0C31A6; border-bottom-color: #0C31A6; box-shadow: none; }

/* ---------- Schichtplan: Touren in hellen Tönen statt kräftiger Vollflächen ---------- */
html body [data-assign], html body [data-edit-abs] { border-radius: 8px !important; padding: 4px 7px !important; border-left: 3px solid transparent; transition: transform .12s, box-shadow .12s; }
html body [data-assign]:hover, html body [data-edit-abs]:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(12, 49, 166, .16); }
html body [data-assign][style*="background:#1E40AF"] { background: #e8eeff !important; color: #0C31A6 !important; border-left-color: #0C31A6; }
html body [data-assign][style*="background:#047857"] { background: #e3f8ef !important; color: #05603f !important; border-left-color: #10b981; }
html body [data-assign][style*="background:#C2410C"] { background: #fff0e4 !important; color: #9a3412 !important; border-left-color: #f97316; }
html body [data-assign][style*="background:#A8A29E"] { background: #f1f5f9 !important; color: #64748b !important; border-left-color: #94a3b8; }
/* Abwesenheit: eigene Farbe je Art bleibt, aber hell überlagert */
html body [data-edit-abs] { background-image: linear-gradient(rgba(255, 255, 255, .78), rgba(255, 255, 255, .78)) !important; color: #374151 !important; }

/* ---------- Status-Kennzeichen als Pillen ---------- */
html body .badge { border-radius: 999px; font-weight: 700; padding: 4px 11px; border-color: transparent; }
html body .badge-blue { background: #eef2ff; color: #0C31A6; }
html body .badge-green { background: #ecfdf5; color: #047857; }
html body .badge-yellow { background: #fff7ed; color: #b45309; }
html body .badge-red { background: #fff1f2; color: #be123c; }
html body .badge-gray { background: #f1f5f9; color: #334155; }
html body .badge-orange { background: #fff7ed; color: #c2410c; }

/* ---------- Fenster ---------- */
html body .modal-overlay { background: rgba(7, 26, 92, .45); }
html body .modal-sheet { border-radius: 24px 24px 0 0; }
html body.hx-desk .modal-sheet { border-radius: 24px; box-shadow: 0 30px 70px rgba(7, 26, 92, .3); }
html body .modal-title { font-weight: 800; color: #111827; }
html body .modal-handle + div[style*="margin-top:8px"] { margin-top: 0 !important; }
/* Aufbau aus harix-modal-ui.js: blauer Kopf, Abschnitte als Karten, feste Knopfleiste */
html body.hx-desk .modal-sheet { max-width: 880px; }
html body .modal-sheet.hx-m-t, html body .modal-sheet.hx-m { background: #f6f8fc; }
html body .modal-sheet.hx-m-t { padding-top: 0; }
html body .modal-sheet.hx-m { padding-bottom: 0 !important; }
html body .modal-sheet > .modal-title.hx-mtitle {
  position: sticky; top: 0; z-index: 6; margin: 0 -20px 16px; padding: 18px 62px 18px 22px;
  background: radial-gradient(500px 160px at 100% 0, rgba(0, 180, 245, .4), transparent 65%), linear-gradient(135deg, #0a2785, #0C31A6);
  color: #fff; font-size: 20px; letter-spacing: -.01em;
}
html body .hx-mtitle span:not([style*="background"]), html body .hx-mtitle div { color: rgba(255, 255, 255, .85) !important; }
html body .hx-mtitle > span:first-child { color: #fff !important; }
html body .hx-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center; }
html body .hx-x:hover { background: rgba(255, 255, 255, .28); }
html body .hx-sec { background: #fff; border: 1px solid #e6ebf4; border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(12, 49, 166, .05); }
html body .hx-sec > .form-group { margin-bottom: 12px; }
html body .hx-sec > .form-group:last-child { margin-bottom: 0; }
html body .hx-sec-h { font-size: 12.5px !important; font-weight: 800 !important; letter-spacing: .05em; text-transform: uppercase; color: #0C31A6 !important; margin: 0 0 12px !important; }
html body.hx-desk .hx-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
html body.hx-desk .hx-sec > * { grid-column: 1 / -1; min-width: 0; }
html body.hx-desk .hx-sec > .form-group { grid-column: auto; margin-bottom: 0; }
html body.hx-desk .hx-sec > .form-group:has(textarea), html body.hx-desk .hx-sec > .form-group.hx-wide { grid-column: 1 / -1; }
html body .modal-sheet > .hx-foot {
  position: sticky !important; bottom: 0 !important; z-index: 6; margin: 16px -20px 0; padding: 12px 20px calc(12px + var(--safe-bottom));
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center;
  background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid #e6ebf4;
}
html body .modal-sheet > .hx-foot .btn { width: auto; margin: 0; }
@media (max-width: 699px) {
  html body .modal-sheet > .hx-foot .btn { flex: 1 1 auto; }
  html body .hx-mtitle { font-size: 18px !important; }
  /* Knopfleiste auch bei kurzen Formularen ganz unten */
  html body #modal .modal-sheet.hx-m { display: flex; flex-direction: column; }
  html body #modal .modal-sheet.hx-m > * { flex-shrink: 0; }
  html body #modal .modal-sheet.hx-m > .hx-foot { margin-top: auto; }
  /* Fenster mit eigenem Scrollbereich (Rechnung): Bereich füllt die freie Höhe */
  html body #modal .modal-sheet.hx-m > div[style*="overflow-y"] { flex: 1 1 auto; min-height: 0; max-height: none !important; }
  /* Mehrspaltige Feldzeilen: am Handy höchstens zwei Felder nebeneinander, mehr rutscht in die nächste Zeile */
  html body #modal .modal-sheet [style*="grid-template-columns"]:not([style*="24px 1fr"]):not([style*="minmax"]) { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; }
  /* mobile.js setzt den unteren Abstand fest; ohne das scheint Inhalt unter der Knopfleiste durch */
  html body #modal .modal-sheet.hx-m { padding-bottom: 0 !important; }
  /* Tabellen im Fenster: Bezeichnung über dem Wert (Umzug: Kunde, Preis & Umfang), langer Text bricht um */
  html body #modal .card td { overflow-wrap: anywhere; }
  html body #modal #umBody table:not(.hx-cards) tr { display: block; padding: 6px 0; }
  html body #modal #umBody table:not(.hx-cards) td { display: block; padding: 0 !important; width: auto !important; }
  html body #modal #umBody table:not(.hx-cards) td:first-child:not(:only-child) { font-size: 11.5px; color: #5b6475; font-weight: 600; }
  html body #modal .modal-sheet [style*="grid-template-columns"] > * { min-width: 0; }
  /* Rechnungspositionen: Beschreibung über die ganze Breite, darunter Menge · Einzelpreis · Gesamt; Spaltenkopf entfällt */
  html body #modal [style*="24px 1fr 80px"]:not([data-pos] *) { display: none !important; }
  html body #modal [data-pos] > [style*="24px 1fr 80px"] { grid-template-columns: 22px 1fr 1fr 1fr 26px !important; }
  html body #modal [data-pos] > div > :nth-child(2) { grid-column: 2 / 5; grid-row: 1; }
  html body #modal [data-pos] > div > :nth-child(3) { grid-column: 2; grid-row: 2; }
  html body #modal [data-pos] > div > :nth-child(4) { grid-column: 3; grid-row: 2; }
  html body #modal [data-pos] > div > :nth-child(5) { grid-column: 4; grid-row: 2; }
  html body #modal [data-pos] > div > :nth-child(6) { grid-column: 5; grid-row: 1; }
  html body #modal [data-pos] textarea { max-height: 120px; }
  html body #modal [data-pos] [data-pos-total] { padding-top: 10px !important; font-size: 14px !important; white-space: nowrap; }
  html body .hx-pos-l { display: block; font-size: 11.5px; font-weight: 600; color: #5b6475; margin-bottom: 3px; text-align: right; }
  /* Kopf des Rechnungsfensters flach halten */
  html body #modal .modal-sheet > div[style*="padding:18px 22px"] { padding: 10px 16px !important; margin-top: 0 !important; }
  html body #invHeaderNumber, html body #invHeaderTotal { font-size: 19px !important; }
  html body #modal .modal-sheet > div[style*="padding:18px 22px"] div[style*="text-transform:uppercase"], html body #invHeaderFirma { display: none; }
  /* Viele Knöpfe: Nebenknöpfe als wischbare Reihe */
  html body .hx-foot-more { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 0 0 100%; margin-bottom: 2px; }
  html body .hx-foot-more::-webkit-scrollbar { display: none; }
  html body .hx-foot-more .btn { flex: none !important; min-height: 38px !important; padding: 6px 12px !important; font-size: 13px; white-space: nowrap; }
  html body .modal-sheet > .hx-foot:has(.hx-foot-more) > div[style*="flex:1"] { display: none; }
  html body .modal-sheet > .hx-foot:has(.hx-foot-more) { padding-top: 8px; }
  html body .modal-sheet > .hx-foot > .btn-outline { flex: 0 1 auto !important; }
  html body .modal-sheet > .hx-foot > .btn-primary { flex: 1 1 60% !important; }
  html body #modal .form-input, html body #modal .form-select { width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* ---------- Untere Leiste (Handy) ---------- */
html body .bottom-nav { border-top: 1px solid #e6ebf4; box-shadow: 0 -8px 24px rgba(12, 49, 166, .08); }
html body .nav-item { color: #9aa6bd; text-transform: none; letter-spacing: 0; font-size: 10.5px; }
html body .nav-item.active { color: #0C31A6; }
html body .nav-badge { background: #e11d48; }

/* ---------- Kleinteile ---------- */
html body .chat-bubble { border-radius: 16px; }
html body .chat-bubble.me { background: var(--hx-grad); }
html body .driver-avatar { background: var(--hx-grad); }
html body .vehicle-icon { background: #eef2ff; color: #0C31A6; border-radius: 12px; }
html body .stop-marker.unload { background: #0C31A6; }
html body .toast { background: #071a5c; border-radius: 12px; }
html body .lang-pill.active { background: #0C31A6; border-color: #0C31A6; }

/* ---------- Fest im Programm hinterlegte schwarze Flächen (Heute-Spalte, aktive Filter) werden blau ---------- */
html body [style*="background:var(--gray-900)"], html body [style*="background:#1C1917"], html body [style*="background:#111827"] { background: #0C31A6 !important; }
html body [style*="linear-gradient(135deg,#1C1917"] { background: linear-gradient(135deg, #0A2785, #0C31A6) !important; }
html body [style*="solid var(--gray-900)"], html body [style*="border-color:#1C1917"] { border-color: #0C31A6 !important; }

/* ---------- Blaues Band mit Seitentitel wie im eingeloggten Portal (harix-ui-shell.js: heroize) ---------- */
html body .page { position: relative; z-index: 0; }
html body .hx-hero { position: relative; padding: 6px 0 24px; margin-bottom: 18px; }
html body .hx-hero::before {
  content: ""; position: absolute; z-index: -1; top: -40px; bottom: 0; left: -100vw; right: -100vw;
  background: radial-gradient(900px 300px at 85% 0, rgba(0, 180, 245, .32), transparent 65%), linear-gradient(180deg, #0a2785 0, #0C31A6 100%);
}
html body .hx-hero.hx-lap { padding-bottom: 46px; margin-bottom: 0; }
html body .hx-hero.hx-lap + * { margin-top: -24px; position: relative; }
html body .hx-hero .page-title { color: #fff; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin-bottom: 4px; }
html body .hx-hero .page-subtitle { color: rgba(255, 255, 255, .8); margin-bottom: 0; font-size: 15px; }
/* Alles Geschriebene im Band weiß, auch wenn die Farbe im Programm fest steht */
html body .hx-hero *:not(input):not(select):not(option):not(textarea) { color: #fff !important; }
html body .hx-hero .page-subtitle, html body .hx-hero .page-title ~ div { opacity: .92; }
/* Knöpfe im Band: durchscheinend wie im Portal, Hauptknopf in Cyan */
html body .hx-hero button, html body .hx-hero .btn, html body .hx-actions button {
  background: rgba(255, 255, 255, .12) !important; border: 1.5px solid rgba(255, 255, 255, .35) !important; box-shadow: none !important; color: #fff !important;
}
html body .hx-hero button:hover, html body .hx-hero .btn:hover { background: rgba(255, 255, 255, .22) !important; transform: none; }
html body .hx-hero .btn-primary, html body .hx-hero .hx-actions button.primary {
  background: #00B4F5 !important; border-color: transparent !important; color: #032053 !important; box-shadow: 0 8px 22px rgba(0, 180, 245, .35) !important;
}
html body .hx-hero .btn-primary *, html body .hx-hero .hx-actions button.primary * { color: #032053 !important; }
html body .hx-hero .btn-primary:hover, html body .hx-hero .hx-actions button.primary:hover { background: #33c4f7 !important; }
/* Außerhalb des Bandes bleiben die Schnellknöpfe im Cockpit normal */
html body .page > :not(.hx-hero) .hx-actions button { background: #fff !important; border: 1.5px solid #dfe5ef !important; color: #0C31A6 !important; }

/* Größere Karten, feste kleine Rundungen aus dem Programm werden angeglichen */
html body #appBody div[style*="border-radius:10px"], html body #appBody div[style*="border-radius:12px"], html body #appBody button[style*="border-radius:10px"], html body #appBody a[style*="border-radius:10px"] { border-radius: 16px !important; }
html body .inv-tbl tr[data-inv]:hover td { background: #f8faff; }
html body .section-header, html body .hx-moregrp { color: #0C31A6; font-weight: 800; letter-spacing: .06em; }

/* Bunte Umrandungs-Knöpfe aus dem Programm einheitlich blau (Rot für Warnungen bleibt) */
html body #appBody .btn-outline[style*="color:"]:not([style*="red"]):not([style*="#B91C1C"]):not([style*="#991B1B"]):not([style*="#DC2626"]) { color: #0C31A6 !important; border-color: #dfe5ef !important; background: #fff !important; }
html body .hx-hero .btn-outline[style*="color:"] { color: #fff !important; background: rgba(255, 255, 255, .12) !important; border-color: rgba(255, 255, 255, .35) !important; }

/* ---------- Handy und schmale Fenster ---------- */
html body:not(.hx-desk) .app-body { padding-bottom: calc(100px + var(--safe-bottom)); }
html body:not(.hx-desk) .bottom-nav {
  left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom)); padding: 5px; gap: 2px;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid #e6ebf4; border-radius: 22px; box-shadow: 0 14px 34px rgba(7, 26, 92, .22);
}
html body:not(.hx-desk) .nav-item { border-radius: 17px; padding: 7px 2px; min-height: 52px; justify-content: center; }
html body:not(.hx-desk) .nav-item.active { background: var(--hx-grad); color: #fff; box-shadow: 0 8px 18px rgba(12, 49, 166, .3); }
html body:not(.hx-desk) .fab { bottom: calc(92px + var(--safe-bottom)); }
html body:not(.hx-desk) .toast { bottom: calc(92px + var(--safe-bottom)); }
/* Nebenknöpfe (u. a. Umzugsfenster) wie die übrigen Umrandungs-Knöpfe */
html body .btn-secondary { background: #fff; color: #0C31A6 !important; border: 1.5px solid #dfe5ef; box-shadow: none; }
html body .btn-secondary:hover { background: rgba(12, 49, 166, .05); border-color: #c9d6f2; }
/* Verbindungs-Punkt nicht über Fenster legen */
html body:has(#modal.open) #harixConnDot, html body:has(#hxPdfView) #harixConnDot { display: none; }

/* Beim Start, solange die Seite noch leer ist */
html body #appBody.hx-loading::before { content: "Daten werden geladen …"; display: flex; align-items: center; justify-content: center; height: 60%; color: #5b6475; font-weight: 600; font-size: 15px; }

/* PDF-Anzeige in der App (harix-phone.js) */
#hxPdfView { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #e9edf5; }
#hxPdfView .hx-pv-bar { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top, 0px)) 12px 10px; background: #0a2785; color: #fff; }
#hxPdfView .hx-pv-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hxPdfView .hx-pv-btn { flex: none; min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .15); color: #fff; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; display: grid; place-items: center; }
#hxPdfView .hx-pv-txt { padding: 0 12px; }
#hxPdfView .hx-pv-pages { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px calc(16px + var(--safe-bottom, 0px)); }
#hxPdfView .hx-pv-pages canvas { display: block; width: 100%; height: auto; max-width: 900px; margin: 0 auto 10px; background: #fff; border-radius: 6px; box-shadow: 0 6px 18px rgba(7, 26, 92, .15); }
#hxPdfView .hx-pv-pages.big canvas { width: 220%; max-width: none; margin-left: 0; }
#hxPdfView .hx-pv-wait { padding: 60px 20px; text-align: center; color: #5b6475; font-weight: 600; }

/* Bezeichnungen der Rechnungspositionen nur am Handy */
.hx-pos-l { display: none; }
.hx-hback { display: none; }
@media (max-width: 699px) {
  html body .hx-phone-hide { display: none !important; }
  /* Drei Kacheln nebeneinander passen nicht: zwei, die dritte über die ganze Breite */
  html body #appBody [style*="grid-template-columns:1fr 1fr 1fr"], html body #appBody [style*="grid-template-columns:repeat(3"], html body #appBody [style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr 1fr !important; }
  html body #appBody [style*="grid-template-columns:1fr 1fr 1fr"] > :last-child:nth-child(odd), html body #appBody [style*="grid-template-columns:repeat(3"] > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  html body .kpi-card { padding: 14px; min-width: 0; }
  html body .kpi-card .kpi-label { font-size: 10.5px; letter-spacing: .04em; overflow-wrap: normal; word-break: normal; }
  html body #appBody .kpi-card .kpi-value { font-size: 20px !important; white-space: nowrap; letter-spacing: -.02em; }
  /* Auswahlfelder mit langem Text bleiben im Rahmen */
  html body #appBody select { max-width: 100%; min-width: 0; }
  html body #appBody label:has(select) { max-width: 100%; flex-wrap: wrap; }
  /* Fester Zurück-Pfeil im Kopf */
  html body .hx-hback { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-right: 8px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }
  html body .app-header { justify-content: flex-start; }
  html body .app-header .header-right { margin-left: auto; }
  /* Band flacher, damit mehr Inhalt sichtbar ist */
  html body .hx-hero { padding: 2px 0 16px; margin-bottom: 14px; }
  html body .hx-hero.hx-lap { padding-bottom: 36px; }
  html body .hx-hero .page-title { font-size: 25px; }
  html body .hx-hero .page-subtitle { font-size: 13.5px; }
  html body .hx-hero .btn, html body .hx-hero button { min-height: 38px; padding: 6px 12px; font-size: 13px; }
  /* Breite Tabellen als Karten (harix-phone.js) */
  html body table.hx-cards, html body table.hx-cards tbody, html body table.hx-cards tfoot { display: block; width: 100% !important; min-width: 0 !important; background: none; border: 0; }
  html body table.hx-cards thead, html body table.hx-cards .hx-head-row { display: none !important; }
  html body table.hx-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 13px 14px; margin-bottom: 10px; background: #fff; border: 1px solid #e6ebf4; border-radius: 16px; box-shadow: 0 6px 16px rgba(12, 49, 166, .05); }
  html body table.hx-cards td, html body table.hx-cards th { display: block; position: static !important; padding: 0 !important; border: 0 !important; text-align: left !important; background: none !important; min-width: 0; width: auto !important; max-width: none !important; white-space: normal !important; overflow-wrap: anywhere; font-size: 14px; }
  html body table.hx-cards-3 tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
  html body table.hx-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: #5b6475; margin-bottom: 1px; font-family: Inter, sans-serif; }
  html body table.hx-cards td.hx-td-title { grid-column: 1 / -1; font-size: 15px; font-weight: 700; }
  html body table.hx-cards td.hx-td-title::before { display: none; }
  html body table.hx-cards td.hx-td-wide, html body table.hx-cards td.hx-td-act { grid-column: 1 / -1; }
  html body table.hx-cards td.hx-td-act::before { display: none; }
  html body table.hx-cards td.hx-td-act { display: flex; gap: 8px; flex-wrap: wrap; }
  html body table.hx-cards td.hx-td-empty { display: none; }
  /* Tabellen-Umrahmung entfällt, die Karten tragen sich selbst */
  html body #appBody .card:has(> table.hx-cards), html body #appBody div:has(> table.hx-cards) { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; overflow: visible !important; }
  html body .page { padding: 14px; }
  html body .card { padding: 16px; }
  html body .hx-hero > div { flex-wrap: wrap; gap: 8px; }
  html body .hx-hero .btn, html body .hx-hero button { white-space: nowrap; flex: none; width: auto !important; }
  /* Knopfreihen seitlich wischen statt über mehrere Zeilen stapeln */
  html body #appBody .page > div[style*="flex-wrap:wrap"]:has(> .btn) { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-right: -14px; padding-right: 14px; }
  html body #appBody .page > div[style*="flex-wrap:wrap"]:has(> .btn)::-webkit-scrollbar { display: none; }
  html body #appBody .page > div[style*="flex-wrap:wrap"]:has(> .btn) > .btn { flex: none; white-space: nowrap; width: auto !important; }
  /* unsichtbarer Filter-Zurücksetzen-Knopf hinterließ eine Lücke */
  html body #invFiltReset[style*="visibility:hidden"] { display: none !important; }
  /* Rechnungs-Kacheln: Beträge passen in die halbe Breite */
  html body [data-inv-status] > div:nth-child(2) { font-size: 15.5px !important; }
  html body .inv-tbl tr[data-inv] { padding: 14px 16px; border-bottom: 1px solid #eef2f8; }
  /* Menü-Kacheln: lange Wörter nicht mitten im Wort abschneiden */
  html body .hx-moregrid { grid-template-columns: 1fr 1fr; }
  html body .hx-tile { padding: 12px 10px; font-size: 13px; gap: 8px; }
  html body .hx-tile span { overflow-wrap: normal; hyphens: auto; }
  html body .hx-kpi .v { font-size: 21px; }
}

/* ---------- Anmeldung ---------- */
html body .login-screen.hx-login { background: #f4f6fb !important; }
html body .hx-login-side { background: radial-gradient(700px 380px at 110% -10%, rgba(0, 180, 245, .45), transparent 60%), linear-gradient(150deg, #0C31A6 0%, #0A2785 55%, #071a5c 100%); }
html body .hx-login-side::after { right: -80px; bottom: -80px; width: 260px; height: 260px; background: none; border: 40px solid rgba(255, 255, 255, .06); }
html body .hx-login-side-main li svg { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; color: #7fdcff; }
html body .login-card.hx-login-card { border: 0; border-radius: 26px; box-shadow: 0 30px 70px rgba(7, 26, 92, .2); }
html body .hx-login-title { color: #111827; }
html body .hx-login-field .form-input:focus { border-color: #0C31A6 !important; box-shadow: var(--hx-ring) !important; }
html body .btn.hx-login-btn { background: var(--hx-grad) !important; border-color: transparent !important; box-shadow: 0 10px 22px rgba(12, 49, 166, .28); }
html body .btn.hx-login-btn:hover { background: linear-gradient(135deg, #0A2785, #0C31A6) !important; }
html body .hx-login-foot a { color: #0C31A6; }
@media (max-width: 900px) {
  html body .hx-login-main { background: linear-gradient(180deg, #0a2785 0, #0C31A6 210px, #f4f6fb 210px); }
}

@media (prefers-reduced-motion: reduce) {
  html body .btn, html body .hx-kpi, html body .hx-tile, html body .hx-day, html body .hx-actions button { transition: none; transform: none !important; }
}
