/* =========================================================
   Buchhaltung 2025 – UI Styles (Full Reset)
   Header 50px • Schwarzer Header • Sidebar 300px • Plesk-like
   ========================================================= */

:root{
  --header-h: 50px;          /* Header-Höhe */
  --sidebar-w: 300px;        /* Sidebar-Breite (eingeklappt siehe .is-collapsed) */
  --accent: #1991EB;         /* Blau-Akzent wie Plesk */
  --header-bg: #000000;      /* Schwarzer Header */
  --sidebar-bg: #1c232b;     /* Dunkle Sidebar */
  --sidebar-hover: #222a33;  /* Sidebar Hover */
  --sidebar-border: #0f141a; /* Sidebar Trennlinie */
  --content-bg: #f5f7fb;     /* Seitenhintergrund */
  /* --card-bg: #ffffff;        /* Kartenhintergrund */
  --text: #0f172a;           /* Standardtext */
  --text-invert: #e5e7eb;    /* Heller Text im Header */
  --muted: #94a3b8;          /* Gedämpfter Text */
  --line: #e5e7eb;           /* Linien / Ränder */

  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(16,24,40,.08);
}

/* Global reset / base ------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--content-bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  color: var(--text-invert);
  border-bottom: 1px solid #0b0f14;
}

/* Header-Grid:
   has-sidebar:   [Sidebar-Spalte | Titel | Aktionen]
   no-sidebar:    [Titel | Aktionen]
*/
.header-inner {
  width: 100%;
  max-width: none;
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.no-sidebar .header-inner {
  grid-template-columns: auto 1fr; /* Login: keine Sidebar-Spalte */
}

/* Eingeklappte Sidebar (falls JS-Toggle genutzt wird) */
.has-sidebar.is-collapsed .header-inner {
  grid-template-columns: 68px 1fr auto;
}

/* Header-Inhalte */
.header-logo {
  display: flex;
  align-items: center;
  justify-content: center; /* Logo zentriert über Sidebar-Spalte */
}
.logo {
  height: 30px;   /* passt in 50px Header */
  width: auto;
  display: block;
  object-fit: contain;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-title {
  color: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}
.version {
  display: inline-block;
  font-size: 11px;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 1px 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

/* Buttons / Icons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
}
.btn:hover { background: #c3d1ec; }
.btn .ico { width: 16px; height: 16px; }
.btn.btn-icon { padding: 6px; }
.logout-form { margin: 0; }

/* Layout (unterhalb Header) ------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar ------------------------------------------------------------------ */
.sidebar-nav {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: #cbd5e1;
}
.sidebar-nav .nav-root { list-style: none; margin: 0; padding: 10px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: 6px;
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active {
  background: var(--sidebar-hover);
  color: #ffffff;
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.sidebar-nav .ico { width: 18px; height: 18px; fill: currentColor; }

.section { margin-top: 12px; }
.section-title {
  display: block;
  margin: 8px 10px;
  color: #93a2b8;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.section ul { list-style: none; margin: 0; padding: 0; }

/* Eingeklappte Sidebar (optional) */
.is-collapsed { --sidebar-w: 68px; }
.is-collapsed .nav-item span,
.is-collapsed .section-title { display: none; }
.is-collapsed .nav-item { justify-content: center; }
.is-collapsed .nav-item.active::before {
  left: calc(50% - 1px);
  height: 3px;
  top: auto;
  bottom: 0;
  width: 20px;
}

/* Main / Subnav ------------------------------------------------------------ */
.main { background: transparent; display: block; }

/* Schlanke Tabs direkt über dem Seiteninhalt */
.subnav {
  height: 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.subnav ul {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}
.subnav a {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  color: #374151;
  line-height: 20px;
}
.subnav a.active {
  background: #e5e7eb;
  color: #111;
  font-weight: 600;
}

/* Seitencontainer ----------------------------------------------------------- */
.page { max-width: 1100px; margin: 16px 16px 32px; }

/* Login-Seite ohne Sidebar */
.auth-main {
  max-width: 420px;
  margin: 12px auto 32px;
  padding: 0 12px;
}

/* Karten / Typografie ------------------------------------------------------ */
.card {
  background: var(--card-bg);
  border: 1px solid #eef2f7;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-header {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
}
.card-body { padding: 14px; }

/* Tabellen ----------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid #eef2f7;
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}
tr:last-child td { border-bottom: 0; }

/* Formulare ---------------------------------------------------------------- */
.form label { display: block; margin-bottom: 10px; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111;
}
.form textarea { min-height: 100px; resize: vertical; }
.form .actions { display: flex; gap: 8px; }

/* Alerts ------------------------------------------------------------------- */
.alert { border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.info  { background: #e0f2fe; color: #075985; }
.alert.ok    { background: #dcfce7; color: #065f46; }

/* Footer ------------------------------------------------------------------- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 980px) {
  :root { --sidebar-w: 220px; }
}

@media (max-width: 720px) {
  /* Header-Grid unabhängig von Sidebar-Breite */
  .has-sidebar .header-inner { grid-template-columns: auto 1fr auto; }
  .header-logo { justify-content: flex-start; }
  .brand-title { font-size: 14px; }
  .logo { height: 28px; }

  /* Layout einkolumnig */
  .layout { grid-template-columns: 1fr; }
  .auth-main { max-width: 94%; }
}
/* Sichtbarkeit des Logout-Buttons verbessern */
.header-actions .btn {
  color: #e5e7eb;                      /* heller Text auf schwarzem Header */
  border: 1px solid rgba(255,255,255,.12);
  background: transparent;
}
.header-actions .btn:hover {
  background: rgba(255,255,255,.06);   /* dezentes Hover */
  border-color: rgba(255,255,255,.2);
}
.header-actions .btn .label {
  font-size: 12px;
  line-height: 1;
}

/* Auf sehr kleinen Screens nur Icon zeigen */
@media (max-width: 720px){
  .header-actions .btn .label { display: none; }
}
.user-pill{
  display:inline-block;background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.15);
  color:#e5e7eb;border-radius:999px;padding:2px 8px;font-size:12px
}
/* === Einheitliche Button-Höhen (global override) ======================= */
button,
a.btn,
button.btn,
input[type="submit"].btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  height: 36px;           /* EINHEITLICHE HÖHE */
  padding: 0 12px;        /* vertikal 0, da feste Höhe */
  border-radius: 6px;
  border: 1px solid transparent;

  font-size: 14px;
  line-height: 1;         /* verhindert „aufgeblasene“ Buttons */
  vertical-align: middle;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

/* Icons im Button */
.btn .ico { width: 16px; height: 16px; flex: 0 0 auto; }
.btn .label { line-height: 1; }

/* Varianten -------------------------------------------------------------- */
.btn-primary { background: #1991EB; color: #fff; border-color: #1991EB; }
.btn-outline  { background: transparent; color: #111; border-color: #d1d5db; }
.btn-ghost    { background: transparent; color: #e5e7eb; border-color: rgba(255,255,255,.12); }
.btn-ghost:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); }

/* Größen (optional nutzen, falls mal kleiner/größer gewünscht) */
.btn--sm { height: 30px; padding: 0 10px; }
.btn--lg { height: 40px; padding: 0 14px; }

/* Icon-only Button (Logout etc.) – quadratisch & gleich hoch */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;             /* kein Innenabstand, zentriertes Icon */
}

/* Spezielle Buttons im Header auf dunklem Hintergrund */
.header-actions .btn { color: #e5e7eb; }
.header-actions .btn .label { font-size: 12px; }

/* (Optional) Formular-Buttons ohne .btn-Klasse angleichen */
.form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* Header-Actions: mehr Abstand + kein Zeilenumbruch */
.header-actions{
  display:flex;
  align-items:center;
  justify-self:end;
  gap: 12px;          /* vorher 6px */
  flex-wrap: nowrap;  /* nicht umbrechen */
}

/* Kleiner Trenner vor dem Logout-Button */
.header-actions .logout-form{
  position: relative;
  margin-left: 6px;
  padding-left: 10px;  /* Platz für den Trenner */
}
.header-actions .logout-form::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(255,255,255,.18); /* dezente Linie auf schwarzem Header */
  border-radius: 1px;
}

/* Einheitliche Button-Höhe/Optik bleibt */
.header-actions .btn{ height:36px; }

/* Labels: auf Desktop sichtbar, auf Mobile nur Icon */
@media (min-width: 721px){
  .header-actions .btn .label{ display:inline; }
}
@media (max-width: 720px){
  .header-actions{ gap: 10px; }
  .header-actions .btn .label{ display:none; }
}

/* === Header-Spacings (mehr Luft, saubere Trennung) === */

/* Mehr Innenabstand links/rechts im Header */
.header-inner{
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Auf großen Screens noch etwas mehr */
@media (min-width: 1280px){
  .header-inner{
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* Aktionen: größerer Abstand + extra Puffer zum Rand */
.header-actions{
  gap: 14px !important;          /* vorher 12/6 */
  padding-right: 8px;            /* verhindert „Kleben“ am rechten Rand */
}

/* Trenner vor Logout: mehr Abstand */
.header-actions .logout-form{
  margin-left: 12px;             /* Abstand zur „Passwort“-Schaltfläche */
  padding-left: 14px;            /* Platz für die Trennlinie */
}
.header-actions .logout-form::before{
  top: 6px;                      /* etwas längere Linie */
  bottom: 6px;
  background: rgba(255,255,255,.22);  /* etwas sichtbarer */
}

/* Buttons in der Header-Aktion minimal breiter wirken lassen */
.header-actions .btn{
  padding: 0 14px;               /* gleich hohe Buttons bleiben erhalten */
}
.header-actions .btn-icon{
  width: 36px; height: 36px;     /* Icon-only bleibt quadratisch */
}

/* Header-Actions Layout vereinheitlichen */
.header-actions{
  display:flex;
  align-items:center;
  gap:14px;          /* mehr Abstand */
  padding-right:10px;
  flex-wrap: nowrap;
}
.header-actions form.logout-form{
  display:flex;      /* Formular wie Link-Button ausrichten */
  margin:0;
  position:relative;
  margin-left:12px;  /* Abstand zum Passwort-Button */
  padding-left:14px; /* Platz für den Trenner */
}
.header-actions form.logout-form::before{
  content:"";
  position:absolute;
  left:0; top:6px; bottom:6px; width:1px;
  background: rgba(255,255,255,.22);
  border-radius:1px;
}

/* Einheitliche Button-Geometrie */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:36px;
  padding:0 14px;
  border-radius:6px;
  border:1px solid transparent;
  font-size:14px;
  line-height:1;
  box-sizing:border-box;
  cursor:pointer;
}
.btn .ico{ width:16px; height:16px; flex:0 0 auto; }
.btn-ghost{ background:transparent; color:#e5e7eb; border-color:rgba(255,255,255,.12); }
.btn-ghost:hover{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.2); }

/* Icon-only Buttons – quadratisch und ohne Text */
.btn-icon{
  width:36px;
  height:36px;
  padding:0;
}
.btn-icon .label{ display:none !important; } /* falls doch Text drin wäre */

/* (Sicherheit) Browser-Defaults für form buttons neutralisieren */
.header-actions button{
  font: inherit;
  background: none;
}

/* Mobile: Labels ausblenden, nur Icons lassen */
@media (max-width: 720px){
  .header-actions .btn .label{ display:none; }
}


/* Header spacing */
.header-inner{ padding-left:20px; padding-right:20px; }
.header-actions{ display:flex; align-items:center; gap:14px; padding-right:12px; flex-wrap:nowrap; }

/* Trenner vor Logout */
.header-actions .logout-form{
  display:flex; margin:0; position:relative;
  margin-left:12px; padding-left:14px; /* Platz für Linie */
}
.header-actions .logout-form::before{
  content:""; position:absolute; left:0; top:6px; bottom:6px; width:1px;
  background:rgba(255,255,255,.22); border-radius:1px;
}

/* Einheitliche Buttons (Icon + Text) */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:36px; padding:0 14px; border-radius:6px; border:1px solid transparent;
  font-size:14px; line-height:1; box-sizing:border-box; cursor:pointer;
}
.btn .ico{ width:16px; height:16px; flex:0 0 auto; }
.btn-ghost{ background:transparent; color:#e5e7eb; border-color:rgba(255,255,255,.12); }
.btn-ghost:hover{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.2); }

/* Form-Buttons im Header sollen wie Links aussehen */
.header-actions button{ font:inherit; background:none; }

/* Optional: auf sehr kleinen Screens Labels ausblenden
@media (max-width: 720px){
  .header-actions .btn .label{ display:none; }
}
*/
/* ---- Card Design ---- */
.page {
    width: 100%;
    max-width: 1100px;
    margin-left: 0;
    margin-right: auto;
    background: #f6f6f6;
    min-height: 90vh;
    padding: 28px 32px 40px 32px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px 0 rgba(0,0,0,0.07);
    margin-bottom: 28px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.card-header {
    padding: 16px 24px;
    background: #f0f4f8;
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: .02em;
    border-bottom: 1px solid #e5e7eb;
}
.card-body {
    padding: 22px 24px;
}
.actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ---- Table ---- */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0;
}
th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1em;
}
th {
    background: #f8fafc;
    text-align: left;
    font-weight: 600;
}
tr:last-child td {
    border-bottom: none;
}
.muted {
    color: #8e9aad;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 6px 20px;
    border: none;
    border-radius: 7px;
    background: #2d6cdf;
    color: #fff;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.14s;
}
.btn:active,
.btn:hover {
    background: #1957b2;
}
.btn-outline {
    background: transparent;
    color: #2d6cdf;
    border: 1px solid #2d6cdf;
}
.btn-outline:hover,
.btn-outline:active {
    background: #e5edfb;
    color: #1747a5;
}
.btn--sm { font-size: .95em; padding: 3px 13px; border-radius: 6px; }

/* ---- Badge ---- */
.badge {
    padding: 2px 8px;
    border-radius: 14px;
    font-size: .92em;
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}
.bg-success { background: #d1fadf; color: #15803d; }

/* ---- Alerts ---- */
.alert { padding: 14px 22px; margin-bottom: 20px; border-radius: 7px; }
.alert.error, .alert-error { background: #fee2e2; color: #991b1b; }
.alert.ok, .alert-success  { background: #dcfce7; color: #166534; }
.alert.warning            { background: #fef9c3; color: #a16207; }

input, select, textarea {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 1em;
    width: 100%;
    margin-top: 2px;
    margin-bottom: 12px;
    transition: border-color 0.12s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2d6cdf;
    background: #fff;
}
label { font-size: .99em; font-weight: 500; color: #263043; margin-bottom: 2px; display: block; }
fieldset { border: none; margin: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 9px; color: #475569; }

/* ---- Subnav ---- */
.subnav ul { display:flex; gap:14px; margin-bottom:22px; margin-top:4px; }
.subnav a { color:#2d6cdf; padding:5px 11px; border-radius:6px; text-decoration:none; }
.subnav a.active, .subnav a:active, .subnav a:hover { background:#e5edfb; color:#1957b2; font-weight:600; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .card-body, .card-header { padding: 13px 8px; }
    table, th, td { font-size: .97em; }
    .actions { flex-direction: column; gap: 8px; }
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-weight: 500;
  margin-bottom: 1em;
}

.form-checkbox input[type="checkbox"] {
  accent-color: #286fa7; /* Moderne Optik, optional */
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  vertical-align: middle;
}
.form-checkbox span {
  margin: 0;
  /* optional: */
  font-weight: 500;
}

.pagination {
  max-width: 100vw;
  overflow-x: auto;
}
.pagination ul {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 14px;}
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;}
.form-row label { display: flex; flex-direction: column; font-size: 15px; }
input[readonly], select[disabled] { background: #f6f6f6; color: #444; cursor: not-allowed; }
.field-title {
  font-weight: 500;
  display: flex;
  align-items: center;
  color: #333;
  font-size: 15px;
  gap: 6px;
  /* Feintuning für Abstand! */
  margin-bottom: 0;        /* KEIN Abstand nach unten */
  padding-top: 2px;        /* Leicht nach unten schieben (passt für Windows+Mac) */
}
.radio-group {
  /* wie bisher */
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f6f6f6;
  padding: 8px 10px;
  min-height: 42px;
  margin:5px 0;
}
.radio-group label {
  display: flex;
  align-items: center;
  font-size: 14px;
  margin: 0;
  gap: 8px;
}
.radio-group input[type="radio"] {
  accent-color: #0077cc;
  margin: 0;
  width: auto;
  vertical-align: middle;
}
.mwst-icon { width: 18px; height: 18px; margin-right: 4px; vertical-align: middle;}
@media (max-width: 900px) {
  .form-row, .form-row-4 { grid-template-columns: 1fr; }
}

@media print {
  .invoice-preview { width:210mm; height:297mm; margin:0; box-shadow:none; border-radius:0; }
}

.invoice-preview {
  background: url('/assets/briefpapier_2014.png') no-repeat center top/cover, #fff;
  width: 794px;    /* A4 bei 96dpi */
  height: 1123px;  /* A4 bei 96dpi */
  position: relative;
  font-family: tahoma, 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 3px 18px #dae2ed44;
  overflow: hidden;
}

/* Absender mini (über Fenster) */
.absender-small {
  position: absolute;
  top: 55mm;
  left: 30mm;
  font-size: 8pt;
  color: #000000;
  font-weight: normal;
  letter-spacing: .02em;
}

/* Empfängeradresse im Fenster */
.sub-address {
  position: absolute;
  top: 60mm;
  left: 30mm;
  width: 75mm;
  min-height: 30mm;
  padding: 0;
  margin: 0;
  font-weight: bold;
  font-size: 11pt;
  line-height: 1.5;
}

.ustid {
  font-weight: bold;
  font-size: 11pt;
  margin-top: 7px;
  display: block;
}

/* Kopf-Daten rechts */
.sub-rechnung {
  position: absolute;
  top: 70mm;
  left: 115mm;
  width: 65mm;
  min-height: 22mm;
  font-size: 9 pt;
}
.sub-rechnung table {
  width: 100%;
  border-collapse: collapse;
}
.sub-rechnung td,
.sub-rechnung th {
  padding: 0;
  border: none;
  font-weight: bold;
  font-size: 8pt;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.sub-rechnung th {
  font-size: 8pt;
  font-weight: normal;
  padding-bottom: 3px;
  letter-spacing: .02em;
}
.sub-rechnung tr:not(:last-child) td {
  padding-bottom: 1px;
}
.sub-rechnung tr td:last-child {
  text-align: left;
}

/* Body ab 95mm links/oben, max 5mm von rechts Rand entfernt */
.invoice-body {
  position: absolute;
  top: 100mm;
  left: 25mm;
  width: 135mm; /* 210 - 25 (links) - 50 (rechts) */
  min-height: 100mm;
  padding-right: 5mm;

  font-size: 10.2pt;
}



/* Positionen: Tabelle ohne th, spezielle Styles */
.positions-table {
  width: 100%;
  border-collapse: collapse;
}

.positions-table {
  width: 100%;
  margin-left: -5px;   /* 5 mm nach links raus */
  border-collapse: collapse;
  border-spacing: 0;
}



.positions-table td {
  padding: 3px 5px;
  vertical-align: top;
}

.td-num { width: 15px; }
.td-price { width: 60px; text-align: right; white-space: nowrap; }

.pos-bold { font-weight: bold; }

.pos-small {
  font-size: smaller;
  font-style: normal;
  margin: 0;
  padding: 0;
}

/* RESET nur für diese Tabelle */
.positions-table, .positions-table * {
  background: transparent !important;
  border: 0 none transparent !important;
  border-collapse: collapse !important;
}
.positions-table { width: 100%; border-spacing: 0 !important; table-layout: auto; }
.positions-table td { padding: 3px 5px; vertical-align: top; }

/* Erzwinge die Linien oben/unten */
.positions-table tr:first-child > td { border-top: 1px solid #000 !important; }
.positions-table tr:last-child  > td { border-bottom: 1px solid #000 !important; }

/* Deine vorhandenen Klassen dürfen bleiben – hier nur falls du sie weiter nutzt */
.pos-top-border    { border-top: 1px solid #000 !important; }
.pos-bottom-border { border-bottom: 1px solid #000 !important; }

/* Spaltenbreiten/Typo */
.td-right { text-align: right; white-space: nowrap; }
.pos-bold { font-weight: 700; }
.pos-artikel { width: 100%; }
.pos-small { font-size: smaller; font-style: normal; margin: 0; padding: 0; }

/* Totals kompakt, rechtsbündig, ohne graue Linien/Hintergründe */
.totals, .totals * {
  background: transparent !important;
  border: 0 none !important;
  border-collapse: collapse !important;
}

.totals {
  width: 100%;             /* gleiche Breite wie Positionen */
  margin: 6px 0 0 -10px;   /* gleiche Einrückung */
  border-collapse: collapse;
  border-spacing: 0;
}
.totals td {
  padding: 1px 0;
}
.totals .label {
  text-align: right;
  padding-right: 10px;
  width: calc(100% - 35mm);   /* alles außer Value-Spalte */
}
.totals .value {
  text-align: right;
  white-space: nowrap;
  width: 35mm;
}
.totals .with-line {
  border-top: 1px solid #000;
  font-weight: 700;
  padding-top: 4px;
}


.totals .value-inner {
  display: block;
  text-align: right;
  white-space: nowrap;
  line-height: 1.2;
  padding-top: 0;                 /* Standard: keine Extra-Luft */
}

/* Linie NUR über dem Brutto-Wert – stark spezifiziert + !important */
.totals tr.grand > td.value > .value-inner.with-line {
  border-top: 1px solid #000 !important;
  padding-top: 4px;               /* etwas Luft über der Linie */
  font-weight: 700;
}

.signature-block {
  margin-top: 10mm; /* Abstand zum Text */
}
.signature-image {
  display: block;
  width: 35mm;     /* oder 30–45mm, je nach Wunsch */
  height: auto;    /* Seitenverhältnis beibehalten */
  margin-bottom: 2mm;
}
.signature-name {
  font-weight: 600;
}

