/* TP Designs · v8.2 UI Refresh
   Compact-Pro-Navigation + Soft-Premium-Inhaltsdesign.
   Ausschliesslich Praesentation: keine Fachlogik, keine API-Vertraege. */

:root{
  --tp-side:#151c28;
  --tp-side-hover:#202a3b;
  --tp-side-active:#263249;
  --tp-side-line:#293244;
  --tp-accent:#655be8;
  --tp-accent-2:#7c6ff2;
  --tp-accent-soft:#f0efff;
  --tp-accent-line:#dedbff;
  --tp-ink:#202431;
  --tp-text:#4f5666;
  --tp-muted:#9299a9;
  --tp-line:#e6e7ee;
  --tp-soft:#f8f8fc;
  --tp-card:#ffffff;
  --tp-shadow:0 12px 34px rgba(42,45,70,.06);
  --tp-sidebar-w:238px;
  --tp-topbar-h:62px;
}

/* ────────────────────────────────────────────────────────────────
   App shell
   ──────────────────────────────────────────────────────────────── */
body.tp-app{
  min-height:100vh;
  background:
    radial-gradient(circle at 92% -10%,rgba(117,99,235,.12),transparent 29%),
    linear-gradient(180deg,#fafaff 0,#f6f7fb 290px,#f6f7fb 100%) !important;
  color:var(--tp-ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.tp-sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--tp-sidebar-w);
  height:100vh;
  z-index:60;
  display:flex;
  flex-direction:column;
  padding:20px 14px 16px;
  background:var(--tp-side);
  color:#c5ccda;
  box-shadow:12px 0 36px rgba(15,22,34,.06);
}
.tp-brand{
  display:block;
  padding:5px 10px 22px;
  text-decoration:none;
  color:#fff;
  font-size:17px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.03em;
}
.tp-brand-accent{color:#7d8cff}
.tp-brand small{
  display:block;
  margin-top:5px;
  color:#68748a;
  font-size:9px;
  line-height:1.2;
  font-weight:750;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.tp-nav-label{
  margin-top:7px;
  padding:5px 11px 7px;
  color:#566175;
  font-size:9px;
  font-weight:850;
  letter-spacing:.11em;
  text-transform:uppercase;
}
.tp-nav-group{display:grid;gap:4px}
.tp-nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:38px;
  padding:9px 11px;
  border-radius:8px;
  color:#99a5b9;
  text-decoration:none;
  font-size:12px;
  font-weight:650;
  transition:background .15s ease,color .15s ease,transform .15s ease;
}
.tp-nav-link:hover{background:var(--tp-side-hover);color:#dbe1eb}
.tp-nav-link.active{
  background:var(--tp-side-active);
  color:#fff;
  box-shadow:inset 3px 0 #657cff;
}
.tp-nav-icon{
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  flex:0 0 18px;
  opacity:.92;
}
.tp-nav-icon svg{width:17px;height:17px;stroke:currentColor}
.tp-sidebar-foot{
  margin-top:auto;
  padding:14px 9px 0;
  border-top:1px solid var(--tp-side-line);
}
.tp-userbox{display:flex;align-items:center;gap:9px;min-width:0}
.tp-avatar{
  width:30px;height:30px;border-radius:50%;flex:0 0 30px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,#6b60e8,#9c8df7);
  color:#fff;font-size:10px;font-weight:850;
}
.tp-userbox-copy{min-width:0;flex:1}
.tp-userbox-copy b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dce2ec;font-size:11px}
.tp-userbox-copy span{display:block;margin-top:1px;color:#768297;font-size:9px}
.tp-user-actions{display:flex;align-items:center;gap:4px}
.tp-side-icon-btn{
  width:28px;height:28px;border-radius:7px;border:0;
  display:grid;place-items:center;
  background:transparent;color:#7f8b9f;font-size:14px;
  transition:.15s ease;
}
.tp-side-icon-btn:hover{background:#222d40;color:#fff}
.tp-testbox{
  width:100%;
  margin-top:11px;
  padding:8px 10px;
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  border:1px solid #3b4961;border-radius:8px;
  background:#2a3548;color:#aeb8c8;
  font-size:10px;font-weight:750;
  transition:.15s ease;
}
.tp-testbox:hover{border-color:#53627d;background:#303d53;color:#d1d8e4}
.tp-testbox:disabled{opacity:.45;cursor:not-allowed}
.tp-testdot{width:7px;height:7px;border-radius:50%;background:#667085;box-shadow:0 0 0 4px rgba(102,112,133,.08)}
.tp-testbox.active{background:#56301d;border-color:#92502c;color:#ffd5bd}
.tp-testbox.active .tp-testdot{background:#fb923c;box-shadow:0 0 0 4px rgba(251,146,60,.13)}

.tp-topbar{
  position:fixed;
  top:0;right:0;left:var(--tp-sidebar-w);
  z-index:50;
  height:var(--tp-topbar-h);
  padding:0 28px;
  display:flex;align-items:center;gap:14px;
  border-bottom:1px solid rgba(224,225,235,.85);
  background:rgba(255,255,255,.82);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
}
.tp-topbar-mobilebrand{display:none;color:var(--tp-ink);font-size:13px;font-weight:900;letter-spacing:-.02em}
.tp-topbar-crumb{min-width:0}
.tp-topbar-crumb small{
  display:block;
  color:#999faf;
  font-size:9px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tp-topbar-crumb strong{
  display:block;
  margin-top:1px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#555d6d;
  font-size:11px;font-weight:750;
}
.tp-topbar-actions{margin-left:auto;display:flex;align-items:center;gap:7px}
.tp-top-chip,.tp-top-icon{
  border:1px solid #e5e6ed;
  background:#fff;
  color:#6d7381;
  box-shadow:0 3px 12px rgba(38,41,64,.03);
}
.tp-top-chip{
  min-height:31px;
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 10px;
  border-radius:999px;
  font-size:10px;font-weight:750;
  text-decoration:none;
}
.tp-top-chip:hover{border-color:#d8d7e8;color:#5148c5;background:#fbfaff}
.tp-top-icon{
  width:32px;height:32px;border-radius:9px;
  display:grid;place-items:center;
  font-size:14px;
  transition:.15s ease;
}
.tp-top-icon:hover{border-color:#d8d7e8;color:#5148c5;background:#fbfaff}
.tp-mobile-nav-toggle{display:none}
.tp-mobile-scrim{display:none}

body.tp-app > main{
  width:min(1470px,calc(100% - var(--tp-sidebar-w)));
  max-width:none !important;
  margin-left:var(--tp-sidebar-w) !important;
  margin-right:0 !important;
  padding:90px 30px 42px !important;
}
body.tp-app.tp-test-active > main{padding-top:132px !important}
#testModeBanner{
  position:fixed !important;
  top:var(--tp-topbar-h) !important;
  left:var(--tp-sidebar-w) !important;
  right:0 !important;
  z-index:49 !important;
  padding:9px 18px !important;
  border:0 !important;
  border-bottom:1px solid #fdba74 !important;
  background:#fff7ed !important;
  color:#9a3412 !important;
  font-size:10px !important;
  font-weight:750 !important;
  box-shadow:0 5px 18px rgba(154,52,18,.04);
}

/* Narrow functional pages keep comfortable reading widths without reverting
   to the old centred top-nav layout. */
body.tp-page-einstellungen > main,
body.tp-page-kategorien > main{width:min(900px,calc(100% - var(--tp-sidebar-w)))}
body.tp-page-backup > main{width:min(1120px,calc(100% - var(--tp-sidebar-w)))}

/* ────────────────────────────────────────────────────────────────
   Soft Premium surfaces
   ──────────────────────────────────────────────────────────────── */
.tp-app main h2{
  color:var(--tp-ink) !important;
  font-weight:850 !important;
  letter-spacing:-.035em;
}
.tp-app main > h2{font-size:27px !important;line-height:1.08;margin-bottom:18px !important}
.tp-app main h3{letter-spacing:-.015em}
.tp-app main .bg-white{background:rgba(255,255,255,.94) !important}
.tp-app main .rounded-xl{border-radius:16px !important}
.tp-app main .rounded-lg{border-radius:10px !important}
.tp-app main .shadow-sm{box-shadow:var(--tp-shadow) !important}
.tp-app main .shadow-lg,.tp-app main .shadow-2xl{box-shadow:0 24px 60px rgba(36,38,58,.14) !important}
.tp-app main .border-gray-200{border-color:var(--tp-line) !important}
.tp-app main .border-gray-300{border-color:#dcdee7 !important}
.tp-app main .bg-gray-50{background:#fafafe !important}
.tp-app main .bg-gray-100{background:#f4f5fa !important}
.tp-app main .text-gray-800{color:#313642 !important}
.tp-app main .text-gray-700{color:#4d5361 !important}
.tp-app main .text-gray-600{color:#666d7c !important}
.tp-app main .text-gray-500{color:#8f96a5 !important}
.tp-app main .text-gray-400{color:#a3a9b6 !important}
.tp-app main .text-blue-600,.tp-app main .text-blue-700{color:var(--tp-accent) !important}
.tp-app main .bg-blue-50{background:#f3f1ff !important}
.tp-app main .bg-blue-100{background:#ebe8ff !important}
.tp-app main .border-blue-200{border-color:#ddd8ff !important}
.tp-app main .bg-blue-600,.tp-app main .bg-blue-700{
  background:linear-gradient(135deg,var(--tp-accent),var(--tp-accent-2)) !important;
  border-color:var(--tp-accent) !important;
  box-shadow:0 8px 20px rgba(101,91,232,.14);
}
.tp-app main .hover\:bg-blue-700:hover,.tp-app main .hover\:bg-blue-800:hover{
  background:linear-gradient(135deg,#5d53dc,#7265ec) !important;
}
.tp-app main a.bg-white,.tp-app main button.bg-white{
  box-shadow:0 4px 14px rgba(43,46,68,.035);
}
.tp-app main input:not([type="checkbox"]):not([type="radio"]):not(.cell-edit),
.tp-app main select:not(.cell-edit):not(.bg-transparent),
.tp-app main textarea:not(.cell-edit){
  border-color:#dedfe7 !important;
  border-radius:10px !important;
  background:#fff;
  color:#404654;
  box-shadow:inset 0 1px 0 rgba(30,34,48,.015);
}
.tp-app main input:not([type="checkbox"]):not([type="radio"]):not(.cell-edit):focus,
.tp-app main select:not(.cell-edit):not(.bg-transparent):focus,
.tp-app main textarea:not(.cell-edit):focus{
  outline:none !important;
  border-color:#bbb5fb !important;
  box-shadow:0 0 0 3px rgba(101,91,232,.09) !important;
}
.tp-app main table:not(#posTable) thead{background:#f7f7fb !important}
.tp-app main table:not(#posTable) th{
  color:#949aa8 !important;
  font-size:9px !important;
  font-weight:850 !important;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.tp-app main table:not(#posTable) tbody tr{transition:background .15s ease}
.tp-app main table:not(#posTable) tbody tr:hover{background:#fcfcff !important}
.tp-app main table:not(#posTable) td{border-color:#eff0f4 !important}

/* Standard page headers become calmer and more spacious. */
.tp-app main > .flex:first-child h2,
.tp-app main > div:first-child h2{font-size:27px !important;line-height:1.08}
.tp-app main > .flex:first-child{margin-bottom:19px !important}

/* ────────────────────────────────────────────────────────────────
   Offer / Invoice editor
   ──────────────────────────────────────────────────────────────── */
.tp-editor-main{width:min(1470px,calc(100% - var(--tp-sidebar-w))) !important}
.tp-editor-hero{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:22px !important;
  margin-bottom:16px !important;
}
.tp-editor-titleblock{min-width:0;flex:1}
.tp-editor-kicker{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-bottom:7px;
  color:#9198a7;
  font-size:10px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.tp-editor-kicker a{color:#858c9c !important;text-decoration:none}
.tp-editor-kicker a:hover{color:var(--tp-accent) !important}
.tp-editor-kicker .tp-sep{color:#d0d3db}
.tp-editor-titleblock h2{
  margin:0 !important;
  color:var(--tp-ink) !important;
  font-size:28px !important;
  line-height:1.06 !important;
  font-weight:900 !important;
  letter-spacing:-.045em !important;
}
.tp-editor-subline{margin-top:7px !important;color:#969cac !important;font-size:11px !important}
.tp-editor-subline select{color:var(--tp-accent) !important;font-weight:750 !important}
.tp-editor-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex-wrap:wrap !important;
}
.tp-pdf-controls{
  display:flex !important;align-items:center !important;gap:10px !important;
  padding:8px 11px !important;
  border:1px solid #e5e6ed !important;
  border-radius:10px !important;
  background:#fff !important;
  color:#747b8b !important;
  box-shadow:0 4px 14px rgba(43,46,68,.035);
}
.tp-pdf-controls > span:first-child{font-size:9px !important;letter-spacing:.05em;text-transform:uppercase;font-weight:850 !important}
.tp-pdf-controls label{font-size:10px !important}
.tp-editor-total{
  min-width:130px;
  padding:9px 13px;
  border:1px solid #e6e7ee;
  border-radius:11px;
  background:rgba(255,255,255,.94);
  box-shadow:0 5px 18px rgba(42,45,70,.04);
  text-align:right;
}
.tp-editor-total > div:first-child{font-size:8px !important;letter-spacing:.06em;text-transform:uppercase;font-weight:850;color:#9ca2b1 !important}
.tp-editor-total #totalSumme{margin-top:1px;font-size:18px !important;font-weight:900 !important;letter-spacing:-.03em;color:#2b303c !important}
.tp-editor-actions > a,
.tp-editor-actions > button{
  min-height:36px;
  border-radius:10px !important;
  font-size:11px !important;
  font-weight:800 !important;
}
.tp-editor-actions > a.bg-green-600{
  background:linear-gradient(135deg,var(--tp-accent),var(--tp-accent-2)) !important;
  box-shadow:0 8px 20px rgba(101,91,232,.16);
}
.tp-editor-meta{
  overflow:hidden;
  padding:0 !important;
  display:grid !important;
  gap:0 !important;
  border:1px solid #e7e7ef !important;
  border-radius:15px !important;
  background:rgba(255,255,255,.92) !important;
  box-shadow:var(--tp-shadow) !important;
}
.tp-editor-meta > div{padding:13px 15px;border-right:1px solid #ececf1}
.tp-editor-meta > div:last-child{border-right:0}
.tp-editor-meta label{
  margin-bottom:5px !important;
  color:#9da2b0 !important;
  font-size:9px !important;
  font-weight:850 !important;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.tp-editor-meta input{padding:7px 9px !important;font-size:11px !important;border-radius:8px !important}
.tp-editor-card{
  overflow:hidden;
  margin-bottom:14px;
  border:1px solid #e6e7ed !important;
  border-radius:16px !important;
  background:#fff !important;
  box-shadow:var(--tp-shadow) !important;
}
.tp-editor-toolbar{
  display:flex !important;align-items:center !important;justify-content:space-between !important;gap:14px !important;
  min-height:51px;
  margin:0 !important;
  padding:12px 15px !important;
  border-bottom:1px solid #eeeff3;
  background:linear-gradient(180deg,#fff,#fdfdff);
}
.tp-editor-toolbar-title{font-size:13px;font-weight:850;color:#363b48;letter-spacing:-.02em}
.tp-editor-toolbar-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.tp-editor-toolbar button{
  padding:7px 10px !important;
  border:1px solid #e3e4eb !important;
  border-radius:8px !important;
  background:#fafaff !important;
  color:#656c7c !important;
  font-size:10px !important;
  font-weight:800 !important;
  box-shadow:none !important;
}
.tp-editor-toolbar button:last-of-type{background:#f0efff !important;border-color:#dcdaff !important;color:#5f55db !important}
.tp-editor-toolbar-hint{color:#a0a6b3;font-size:9px}
.tp-editor-add{
  width:calc(100% - 28px) !important;
  margin:12px 14px 14px !important;
  padding:10px !important;
  border:1px dashed #d9d9e4 !important;
  border-radius:10px !important;
  background:#fcfcfe !important;
  color:#888f9e !important;
  font-size:10px !important;
  font-weight:800 !important;
}
.tp-editor-add:hover{border-color:#beb9ef !important;color:#5f55db !important;background:#faf9ff !important}
.tp-editor-payment{border-radius:16px !important;box-shadow:var(--tp-shadow) !important}

/* The editors define legacy table CSS inline. These rules are intentionally
   loaded after it and therefore form the visual contract for v8.2. */
.tp-editor-main #posTable{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px}
.tp-editor-main #posTable th{
  padding:10px 9px !important;
  border-bottom:1px solid #e8e8ee !important;
  background:#f7f7fb !important;
  color:#9399a7 !important;
  font-size:9px !important;
  font-weight:850 !important;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.tp-editor-main #posTable td{border-bottom:1px solid #f0f0f3 !important;color:#555c6b}
.tp-editor-main #posTable tr:hover:not(.row-gruppe-0):not(.row-gruppe-1):not(.row-gruppe-2) td{background:#fcfcff !important}
.tp-editor-main .row-gruppe-0 td,
.tp-editor-main .row-gruppe-1 td,
.tp-editor-main .row-gruppe-2 td{
  background:linear-gradient(90deg,#f0efff,#f8f7ff) !important;
  color:#5e55d8 !important;
  border-top:1px solid #e0deff !important;
  border-bottom:1px solid #e7e5ff !important;
  font-weight:800;
}
.tp-editor-main .row-position td{background:#fff !important;color:#4f5666 !important}
.tp-editor-main .row-lohn td,
.tp-editor-main .row-material td,
.tp-editor-main .row-sonstiges td{background:#fcfcfe !important;color:#777e8e !important}
.tp-editor-main .row-position:hover td,
.tp-editor-main .row-lohn:hover td,
.tp-editor-main .row-material:hover td,
.tp-editor-main .row-sonstiges:hover td{background:#fafaff !important}
.tp-editor-main .cell-edit{
  min-height:34px !important;
  padding:6px 8px !important;
  color:inherit !important;
  font-size:11px !important;
}
.tp-editor-main .row-gruppe-0 .cell-edit,
.tp-editor-main .row-gruppe-1 .cell-edit,
.tp-editor-main .row-gruppe-2 .cell-edit{color:#5e55d8 !important;font-weight:800}
.tp-editor-main .cell-edit:focus{
  border-radius:6px !important;
  outline:2px solid rgba(101,91,232,.35) !important;
  background:#fff !important;
  box-shadow:0 0 0 3px rgba(101,91,232,.06);
}
.tp-editor-main .drag-handle{color:#bbc0cc !important}
.tp-editor-main .type-badge{
  display:inline-flex !important;align-items:center;
  padding:4px 7px !important;
  border:1px solid #e5e6ec !important;
  border-radius:999px !important;
  background:#fafafd !important;
  color:#7a8190 !important;
  font-size:8px !important;
  font-weight:850 !important;
  letter-spacing:.045em;
  text-transform:uppercase;
  white-space:nowrap;
}
.tp-editor-main .row-gruppe-0 .type-badge,
.tp-editor-main .row-gruppe-1 .type-badge,
.tp-editor-main .row-gruppe-2 .type-badge{background:#e8e5ff !important;border-color:#d7d3ff !important;color:#5e55d8 !important}
.tp-editor-main #tableFooter td{
  padding-top:10px !important;padding-bottom:10px !important;
  border-top:1px solid #e5e6ec !important;
  background:#fafafe !important;
  color:#737a89 !important;
  font-weight:850 !important;
}
.tp-editor-main #footerGP{color:#2f3440 !important;font-size:13px !important}
.tp-editor-main tr.selected td{outline:2px solid rgba(101,91,232,.46) !important;outline-offset:-2px}
.tp-editor-main tr.drag-over td{border-top:2px solid var(--tp-accent) !important}
.tp-editor-main #ctxMenu{border-color:#e3e4eb !important;border-radius:10px !important;box-shadow:0 18px 45px rgba(32,35,52,.16) !important}
.tp-editor-main .ctx-item{font-size:11px !important;color:#565d6c !important}
.tp-editor-main .ctx-item:hover{background:#f6f5ff !important;color:#5148c5 !important}

/* ────────────────────────────────────────────────────────────────
   Dark mode
   ──────────────────────────────────────────────────────────────── */
.dark body.tp-app{
  background:
    radial-gradient(circle at 92% -10%,rgba(101,91,232,.16),transparent 27%),
    linear-gradient(180deg,#151722 0,#11131b 320px,#11131b 100%) !important;
  color:#e4e6ed;
}
.dark .tp-topbar{background:rgba(24,27,38,.84);border-bottom-color:#292d3b}
.dark .tp-topbar-mobilebrand{color:#f3f4f8}
.dark .tp-topbar-crumb small{color:#696f7e}
.dark .tp-topbar-crumb strong{color:#b7bcc8}
.dark .tp-top-chip,.dark .tp-top-icon{background:#1c202c;border-color:#303544;color:#aeb4c1;box-shadow:none}
.dark .tp-top-chip:hover,.dark .tp-top-icon:hover{background:#232737;border-color:#46405f;color:#c9c4ff}
.dark .tp-app main h2{color:#f0f1f5 !important}
.dark .tp-app main .bg-white{background:#1b1e29 !important}
.dark .tp-app main .bg-gray-50{background:#181b25 !important}
.dark .tp-app main .bg-gray-100{background:#1d202b !important}
.dark .tp-app main .border-gray-200,.dark .tp-app main .border-gray-300{border-color:#303442 !important}
.dark .tp-app main .text-gray-800{color:#eceef4 !important}
.dark .tp-app main .text-gray-700{color:#d5d8e1 !important}
.dark .tp-app main .text-gray-600{color:#bec3cf !important}
.dark .tp-app main .text-gray-500{color:#979eae !important}
.dark .tp-app main .text-gray-400{color:#747c8c !important}
.dark .tp-app main input:not([type="checkbox"]):not([type="radio"]):not(.cell-edit),
.dark .tp-app main select:not(.cell-edit):not(.bg-transparent),
.dark .tp-app main textarea:not(.cell-edit){background:#20242f !important;border-color:#373c4b !important;color:#e8eaf0 !important}
.dark .tp-app main table:not(#posTable) thead{background:#1d202b !important}
.dark .tp-app main table:not(#posTable) tbody tr:hover{background:#20232f !important}
.dark .tp-app main table:not(#posTable) td{border-color:#292d38 !important}
.dark .tp-editor-titleblock h2{color:#f2f3f7 !important}
.dark .tp-editor-kicker{color:#72798a}
.dark .tp-pdf-controls,.dark .tp-editor-total,.dark .tp-editor-card,.dark .tp-editor-meta{background:#1b1e29 !important;border-color:#303442 !important;box-shadow:0 12px 34px rgba(0,0,0,.12) !important}
.dark .tp-editor-total #totalSumme{color:#f0f1f5 !important}
.dark .tp-editor-toolbar{background:linear-gradient(180deg,#1d202b,#1b1e29);border-bottom-color:#303442}
.dark .tp-editor-toolbar-title{color:#dfe2ea}
.dark .tp-editor-toolbar button{background:#202430 !important;border-color:#373c4b !important;color:#b8becb !important}
.dark .tp-editor-toolbar button:last-of-type{background:#2b2842 !important;border-color:#494368 !important;color:#c7c0ff !important}
.dark .tp-editor-add{background:#181b25 !important;border-color:#3a3f4d !important;color:#858c9c !important}
.dark .tp-editor-main #posTable th{background:#1d202b !important;border-bottom-color:#303442 !important;color:#858c9b !important}
.dark .tp-editor-main #posTable td{border-bottom-color:#292d38 !important}
.dark .tp-editor-main .row-gruppe-0 td,
.dark .tp-editor-main .row-gruppe-1 td,
.dark .tp-editor-main .row-gruppe-2 td{background:linear-gradient(90deg,#292640,#232235) !important;color:#c5bfff !important;border-color:#403a62 !important}
.dark .tp-editor-main .row-position td{background:#1b1e29 !important;color:#d5d8e1 !important}
.dark .tp-editor-main .row-lohn td,.dark .tp-editor-main .row-material td,.dark .tp-editor-main .row-sonstiges td{background:#181b25 !important;color:#adb3c0 !important}
.dark .tp-editor-main .row-position:hover td,.dark .tp-editor-main .row-lohn:hover td,.dark .tp-editor-main .row-material:hover td,.dark .tp-editor-main .row-sonstiges:hover td{background:#20232f !important}
.dark .tp-editor-main .row-gruppe-0 .cell-edit,.dark .tp-editor-main .row-gruppe-1 .cell-edit,.dark .tp-editor-main .row-gruppe-2 .cell-edit{color:#c5bfff !important}
.dark .tp-editor-main .cell-edit:focus{background:#242836 !important;outline-color:#746af0 !important}
.dark .tp-editor-main .type-badge{background:#202430 !important;border-color:#373c4b !important;color:#9da4b2 !important}
.dark .tp-editor-main .row-gruppe-0 .type-badge,.dark .tp-editor-main .row-gruppe-1 .type-badge,.dark .tp-editor-main .row-gruppe-2 .type-badge{background:#383251 !important;border-color:#4d466d !important;color:#c8c2ff !important}
.dark .tp-editor-main #tableFooter td{background:#1d202b !important;border-top-color:#303442 !important;color:#9ea5b3 !important}
.dark .tp-editor-main #footerGP{color:#eef0f4 !important}
.dark #testModeBanner{background:#342316 !important;border-bottom-color:#6c4325 !important;color:#fdba74 !important}

/* ────────────────────────────────────────────────────────────────
   Login
   ──────────────────────────────────────────────────────────────── */
body.tp-login{
  min-height:100vh;
  background:
    radial-gradient(circle at 78% 10%,rgba(117,99,235,.16),transparent 30%),
    linear-gradient(135deg,#f4f5fb,#fafaff 54%,#f0efff) !important;
}
body.tp-login > div{
  border:1px solid #e5e6ed;
  border-radius:18px !important;
  box-shadow:0 28px 70px rgba(42,45,70,.12) !important;
}
body.tp-login input{border-radius:10px !important;border-color:#dedfe7 !important}
body.tp-login button[type="submit"]{border-radius:10px !important;background:linear-gradient(135deg,var(--tp-accent),var(--tp-accent-2)) !important;box-shadow:0 10px 24px rgba(101,91,232,.18)}
.dark body.tp-login{background:radial-gradient(circle at 78% 10%,rgba(101,91,232,.18),transparent 30%),#11131b !important}
.dark body.tp-login > div{background:#1b1e29 !important;border-color:#303442 !important}

/* ────────────────────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────────────────────── */
@media(max-width:1080px){
  :root{--tp-sidebar-w:214px}
  body.tp-app > main{padding-left:22px !important;padding-right:22px !important}
  .tp-editor-hero{flex-direction:column !important}
  .tp-editor-actions{width:100%;justify-content:flex-start !important}
}
@media(max-width:767px){
  :root{--tp-sidebar-w:0px;--tp-topbar-h:58px}
  .tp-sidebar{
    width:238px;
    transform:translateX(-102%);
    transition:transform .2s ease;
    box-shadow:18px 0 45px rgba(12,18,29,.24);
  }
  body.tp-sidebar-open .tp-sidebar{transform:translateX(0)}
  .tp-topbar{left:0;padding:0 14px}
  .tp-topbar-mobilebrand{display:block}
  .tp-topbar-crumb{display:none}
  .tp-topbar-actions .tp-top-chip{display:none}
  .tp-mobile-nav-toggle{
    width:34px;height:34px;display:grid;place-items:center;
    border:1px solid #e5e6ed;border-radius:9px;background:#fff;color:#626979;
  }
  .dark .tp-mobile-nav-toggle{background:#1c202c;border-color:#303544;color:#b8beca}
  .tp-mobile-scrim{
    position:fixed;inset:0;z-index:55;
    background:rgba(11,16,25,.46);
    -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
  }
  body.tp-sidebar-open .tp-mobile-scrim{display:block}
  body.tp-app > main,
  body.tp-page-einstellungen > main,
  body.tp-page-kategorien > main,
  body.tp-page-backup > main,
  .tp-editor-main{
    width:100% !important;
    margin-left:0 !important;
    padding:78px 14px 28px !important;
  }
  body.tp-app.tp-test-active > main{padding-top:118px !important}
  #testModeBanner{left:0 !important;top:var(--tp-topbar-h) !important;font-size:9px !important;padding:8px 10px !important}
  .tp-editor-titleblock h2{font-size:24px !important}
  .tp-editor-actions{align-items:stretch !important}
  .tp-editor-actions .tp-pdf-controls{width:100%;justify-content:flex-start}
  .tp-editor-total{min-width:126px}
  .tp-editor-toolbar{align-items:flex-start !important;flex-direction:column !important}
  .tp-editor-meta{grid-template-columns:1fr !important}
  .tp-editor-meta > div{border-right:0;border-bottom:1px solid #ececf1}
  .tp-editor-meta > div:last-child{border-bottom:0}
  .dark .tp-editor-meta > div{border-bottom-color:#303442}
}

/* v8.5.3 – 2FA enrollment UI. Semantic classes keep setup readable in both themes. */
.tp-2fa-setup{
  border:1px solid #c7d2fe;
  background:linear-gradient(180deg,#f5f7ff 0%,#eef2ff 100%);
  border-radius:14px;
  padding:18px;
  color:#26324a;
}
.tp-2fa-setup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.tp-2fa-setup-head h4{margin:0;color:#1e2d4d;font-size:.95rem;font-weight:700}
.tp-2fa-setup-head p{margin:4px 0 0;color:#667085;font-size:.82rem;line-height:1.45}
.tp-2fa-step{display:inline-flex;align-items:center;white-space:nowrap;border:1px solid #c7d2fe;background:#fff;color:#4f46e5;border-radius:999px;padding:5px 9px;font-size:.7rem;font-weight:700}
.tp-2fa-enrollment-grid{display:grid;grid-template-columns:minmax(210px,250px) minmax(0,1fr);gap:18px;align-items:start}
.tp-2fa-qr-card{background:#fff;border:1px solid #dbe3f5;border-radius:12px;padding:14px;text-align:center;box-shadow:0 8px 22px rgba(31,41,55,.05)}
.tp-2fa-qr-label{margin-bottom:10px;color:#344054;font-size:.75rem;font-weight:700}
.tp-2fa-qr{width:min(100%,220px);aspect-ratio:1/1;margin:0 auto;background:#fff;border:8px solid #fff;border-radius:10px;display:grid;place-items:center;overflow:hidden}
.tp-2fa-qr svg{display:block;width:100%;height:100%;background:#fff}
.tp-2fa-qr-loading{font-size:.75rem;color:#667085;padding:14px}
.tp-2fa-qr-error{aspect-ratio:auto;min-height:150px;border:1px solid #fecaca;background:#fff7f7;color:#b42318;font-size:.75rem;line-height:1.4;padding:16px}
.tp-2fa-qr-card > p{margin:10px 0 0;color:#667085;font-size:.72rem;line-height:1.45}
.tp-2fa-manual{min-width:0}
.tp-2fa-steps{margin:0;padding-left:1.25rem;color:#344054;font-size:.82rem;line-height:1.55}
.tp-2fa-steps li+li{margin-top:5px}
.tp-2fa-secret-wrap{margin-top:14px}
.tp-2fa-secret-label{margin-bottom:5px;color:#667085;font-size:.67rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.tp-2fa-secret{border:1px solid #d0d5dd;background:#fff;color:#1d2939;border-radius:10px;padding:11px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:.86rem;font-weight:700;letter-spacing:.09em;line-height:1.55;overflow-wrap:anywhere}
.tp-2fa-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.tp-2fa-secondary{display:inline-flex;align-items:center;justify-content:center;border:1px solid #c7d2fe;background:#fff;color:#4338ca;border-radius:9px;padding:7px 10px;font-size:.73rem;font-weight:700;text-decoration:none;transition:.15s ease}
.tp-2fa-secondary:hover{background:#eef2ff;border-color:#a5b4fc}
.tp-2fa-privacy{margin:11px 0 0;color:#667085;font-size:.7rem;line-height:1.45}

.dark .tp-app .tp-2fa-setup{background:linear-gradient(180deg,#222637 0%,#1d2130 100%);border-color:#3c4358;color:#dfe3ec}
.dark .tp-app .tp-2fa-setup-head h4{color:#f1f3f8}
.dark .tp-app .tp-2fa-setup-head p{color:#9da5b5}
.dark .tp-app .tp-2fa-step{background:#292e40;border-color:#444c65;color:#c8c3ff}
.dark .tp-app .tp-2fa-qr-card{background:#181b25;border-color:#343a4c;box-shadow:none}
.dark .tp-app .tp-2fa-qr-label{color:#cfd4de}
.dark .tp-app .tp-2fa-qr-card > p{color:#8f98a9}
.dark .tp-app .tp-2fa-steps{color:#c5cad5}
.dark .tp-app .tp-2fa-secret-label{color:#8f98a9}
.dark .tp-app .tp-2fa-secret{background:#181b25;border-color:#3b4254;color:#eef0f5}
.dark .tp-app .tp-2fa-secondary{background:#24293a;border-color:#454c64;color:#cbc6ff}
.dark .tp-app .tp-2fa-secondary:hover{background:#2c3246;border-color:#5a6380}
.dark .tp-app .tp-2fa-privacy{color:#8f98a9}
.dark .tp-app .tp-2fa-qr-error{background:#2b2024;border-color:#6d3942;color:#fca5a5}

@media (max-width:700px){
  .tp-2fa-enrollment-grid{grid-template-columns:1fr}
  .tp-2fa-qr-card{max-width:280px;width:100%;margin:0 auto}
  .tp-2fa-setup-head{align-items:flex-start}
}
.tp-2fa-confirm{margin-top:14px;border:1px solid #e4e7ec;background:#fff;border-radius:12px;padding:14px}
.tp-2fa-confirm-head{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#344054;font-size:.82rem;font-weight:800}
.tp-2fa-confirm > p{margin:7px 0 0;color:#667085;font-size:.75rem;line-height:1.45}
.dark .tp-app .tp-2fa-confirm{background:#1b1e29;border-color:#343a4c}
.dark .tp-app .tp-2fa-confirm-head{color:#e6e8ee}
.dark .tp-app .tp-2fa-confirm > p{color:#929aaa}
