
    .orders-search-row {
      margin: 0 0 0.75rem 0;
    }

    .orders-search-row input {
      width: 100%;
      padding: 0.5rem 0.75rem;
      border-radius: 999px;
      border: 1px solid var(--border);
      font-size: 0.9rem;
    }

    .orders-search-row input:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }


    :root {
      --bg: #f5f5f7;
      --card-bg: #ffffff;
      --border: #d0d0d7;
      --accent: #2563eb;
      --accent-soft: #e0ecff;
      --text-main: #111827;
      --text-muted: #6b7280;
      --danger: #b91c1c;
      --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: radial-gradient(circle at top left, #eef2ff, #f9fafb);
      color: var(--text-main);
    }

    h1, h2, h3 {
      margin: 0;
    }

    a {
      color: var(--accent);
    }

    .app-shell {
      min-height: 100vh;
      height: 100vh;
      display: flex;
      flex-direction: column;
    }

    header {
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      position: sticky;
      top: 0;
      z-index: 10;
    }

    header h1 {
      font-size: 1.3rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    header h1 span.logo {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      background: linear-gradient(135deg, #2563eb, #4f46e5);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 700;
      font-size: 0.9rem;
      box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    }

    header .subtitle {
      font-size: 0.85rem;
      color: var(--text-muted);
    }

    main {
      flex: 1;
      min-height: 0;
      padding: 20px;
      max-width: 1300px;
      width: 100%;
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
      gap: 20px;
    }

    @media (max-width: 900px) {
      main {
        grid-template-columns: minmax(0, 1fr);
      }
    }

    .card {
      background: var(--card-bg);
      border-radius: 18px;
      padding: 16px 18px 18px;
      box-shadow: var(--shadow-soft);
      border: 1px solid rgba(148, 163, 184, 0.35);
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      gap: 8px;
    }

    .card-header h2 {
      font-size: 1.05rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-header h2 span.emoji {
      font-size: 1.1rem;
    }

    .card-header .hint {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    label {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-bottom: 4px;
      display: block;
    }

    input[type="file"],
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
      width: 100%;
      font-size: 0.9rem;
      padding: 7px 9px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #f9fafb;
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    input[type="file"] {
      padding: 5px 6px;
    }

    input:focus,
    textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
      background: white;
    }

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

    .field-row {
      margin-bottom: 10px;
    }

    .field-row-inline {
      display: flex;
      gap: 10px;
    }

    .field-row-inline .field {
      flex: 1;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      background: var(--accent-soft);
      color: var(--accent);
      font-size: 0.75rem;
      font-weight: 500;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border-radius: 999px;
      border: 1px solid transparent;
      font-size: 0.85rem;
      padding: 6px 12px;
      cursor: pointer;
      background: var(--accent);
      color: white;
      font-weight: 500;
      transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    }

    .btn:hover {
      background: #1d4ed8;
      box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
      transform: translateY(-1px);
    }

    .btn:active {
      transform: translateY(0);
      box-shadow: none;
    }

    .btn-secondary {
      background: white;
      color: var(--text-main);
      border-color: var(--border);
    }

    .btn-secondary:hover {
      background: #f3f4f6;
      box-shadow: none;
    }

    .btn-sm {
      padding: 4px 10px;
      font-size: 0.8rem;
    }

    .btn-danger {
      background: var(--danger);
      color: white;
    }

    .status-text {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 4px;
    }

    .status-text strong {
      color: var(--text-main);
    }

    .orders-table-wrapper {
      
      
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(15, 23, 42, 0.9);
    }
    .card.card-orders {
      display: flex;
      flex-direction: column;
      min-height: 0;
      max-height: 100%;
    }

    .card.card-orders .orders-table-wrapper {
      flex: 1;
      min-height: 0;
      max-height: 100%;
      overflow-y: auto;
    }



    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.84rem;
    }

    thead {
      position: sticky;
      top: 0;
      background: #e5e7eb;
      z-index: 1;
    }

    th, td {
      padding: 6px 8px;
      border-bottom: 1px solid #e5e7eb;
      text-align: left;
    }

    th {
      font-weight: 600;
      font-size: 0.83rem;
      color: #374151;
    }

    tbody tr:nth-child(even) {
      background: rgba(15, 23, 42, 0.95);
    }

    tbody tr:hover {
      background: rgba(37, 99, 235, 0.25);
    }

    .text-right {
      text-align: right;
    }

    .empty-hint {
      font-size: 0.85rem;
      color: var(--text-muted);
      padding: 8px 2px;
    }

    .chips-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 6px;
    }

    .chip {
      font-size: 0.74rem;
      padding: 3px 7px;
      border-radius: 999px;
      border: 1px dashed var(--border);
      color: var(--text-muted);
    }

    .section-actions {
      margin-top: 10px;
      display: flex;
      justify-content: flex-end;
      flex-wrap: wrap;
      gap: 8px;
    }

    /* MODAL / VORSCHAU-FENSTER */

    .invoice-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(15, 23, 42, 0.55);
      padding: 16px;
      z-index: 40;
    }

    .invoice-modal.open {
      display: flex;
    }

    .invoice-modal-content {
      max-width: 100%;
      width: 100%;
      max-height: 100%;
      overflow: auto;
      background: transparent;
      border-radius: 0;
      box-shadow: none;
      border: none;
      padding: 12px 8px 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .invoice-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      gap: 8px;
      width: 210mm;
      max-width: calc(100vw - 40px);
      color: #f9fafb;
    }
#vat-config-modal .invoice-modal-header {
  width: 100%;
  max-width: 100%;
  color: inherit;
}

#manual-invoice-modal .invoice-modal-header {
  width: 100%;
  max-width: 100%;
  color: inherit;
}


    .invoice-modal-header-title {
      font-size: 1rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .invoice-modal-footer {
      margin-top: 8px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      width: 210mm;
      max-width: calc(100vw - 40px);
    }

    .invoice-modal-footer-buttons {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    /* INVOICE LAYOUT – A4-Vorschau */

    /* Force light invoice theme (screen + export) */
    #invoice-container,
    #invoice-container * {
      color: #111827;
      background-color: transparent;
    }

#invoice-container {
      background: #ffffff;
      border-radius: 4px;
      padding: 15mm;
      width: 210mm;
      max-width: calc(100vw - 40px);
      box-shadow: 0 14px 40px rgba(15, 23, 42, 0.45);
      border: 1px solid rgba(148, 163, 184, 0.7);
      color: #111827;
      margin: 0 auto;
    }

    #invoice-header {
      display: flex;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 12px;
      align-items: flex-start;
    }

    #invoice-seller-block {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      max-width: 60%;
    }

    #invoice-logo {
      max-width: 120px;
      max-height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #invoice-logo img {
      max-width: 120px;
      max-height: 60px;
      object-fit: contain;
      display: block;
    }

    #invoice-seller {
      font-size: 0.9rem;
    }

    #invoice-seller strong {
      font-size: 1rem;
    }

    #invoice-meta-block {
      text-align: right;
      font-size: 0.85rem;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
    }

    #invoice-meta div {
      margin-bottom: 3px;
    }

    #invoice-qrcode {
      text-align: right;
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    #invoice-qrcode-inner {
      margin-left: auto;
      margin-bottom: 4px;
    }

    #invoice-qrcode-inner img,
    #invoice-qrcode-inner canvas {
      width: 70px;
      height: 70px;
    }

    #invoice-buyer {
      margin-top: 10px;
      margin-bottom: 10px;
      font-size: 0.9rem;
    }

    #invoice-buyer strong {
      display: block;
      margin-bottom: 3px;
    }

    #invoice-intro {
      font-size: 0.9rem;
      margin: 10px 0 12px;
    }

    #invoice-items {
      margin-top: 4px;
    }

    #invoice-items table {
      font-size: 0.82rem;
      border-radius: 10px;
      overflow: hidden;
    }

    #invoice-items thead {
      background: #e5e7eb;
    }

    #invoice-items th, #invoice-items td {
      border-bottom: 1px solid #e5e7eb;
    }

    #invoice-summary {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
    }

    #invoice-summary table {
      font-size: 0.82rem;
    }

    #invoice-summary td {
      padding: 3px 0 3px 18px;
    }

    
    #invoice-summary tr {
      background: #ffffff;
    }

    #invoice-summary tr.subtotal-row td,
    #invoice-summary tr.total-row td {
      background: #e5e7eb;
    }
#invoice-summary tr.total-row td {
      font-weight: 600;
      border-top: 1px solid #111827;
      padding-top: 5px;
    }

    #invoice-footer {
      margin-top: 18px;
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    #invoice-current-order {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    #company-logo-preview img {
      max-width: 120px;
      max-height: 60px;
      object-fit: contain;
      display: block;
      margin-top: 4px;
      border-radius: 8px;
      border: 1px solid var(--border);
      padding: 4px;
      background: #f9fafb;
    }

    /* PRINT STYLES: Nur Rechnung drucken aus dem Vorschau-Fenster */
    @media print {
      html, body {
        margin: 0;
        padding: 0;
        background: white;
      }

      /* Hide the normal app chrome */
      header,
      main,
      footer,
      .app-shell > header,
      .app-shell > main,
      .app-shell > footer {
        display: none !important;
      }

      /* Hide modal chrome, keep only the invoice content */
      .invoice-modal-header,
      .invoice-modal-footer,
      .invoice-modal-backdrop,
      #vat-config-modal {
        display: none !important;
      }

      /* Show the invoice preview modal as a normal static block */
      #invoice-modal {
        display: block !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
      }

      #invoice-modal .invoice-modal-content {
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        align-items: stretch !important;
      }

      #invoice-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15mm !important;
      }

      /* Ensure strong contrast for print */
      #invoice-container,
      #invoice-container * {
        color: #111827 !important;
        background-color: transparent !important;
      }

      #invoice-summary tr.subtotal-row td,
      #invoice-summary tr.total-row td {
        background-color: #e5e7eb !important;
      }
    }

/* --- VAT Config Modal Styling --- */

#vat-config-modal {
  overflow-x: hidden;
}

#vat-config-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#vat-config-modal .invoice-modal-content {
  box-sizing: border-box;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border);
  padding: 16px 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

#vat-config-modal .invoice-modal-body {
  max-height: 70vh;
  overflow: auto;
}

#vat-config-modal table {
  width: 100%;
  border-collapse: collapse;
}

#vat-config-modal thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
}

#vat-config-modal tbody td {
  padding: 4px 8px;
  vertical-align: middle;
}

#vat-config-modal .input-iso {
  width: 90px;
  max-width: 100%;
  text-transform: uppercase;
}

#vat-config-modal .input-rate {
  width: 110px;
  max-width: 100%;
  text-align: right;
}

#vat-config-modal .btn.btn-sm.btn-secondary {
  padding: 4px 8px;
}

#vat-config-modal #vat-modal-add-row {
  margin-top: 8px;
}


#vat-config-modal tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.08);
}

#vat-config-modal tbody tr:hover {
  background: rgba(59, 130, 246, 0.09);
}


#manual-invoice-modal .invoice-modal-content {
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border);
  padding: 16px 20px;
}

.manual-invoice-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 12px;
}

.manual-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f9fafb;
}

.manual-fieldset legend {
  padding: 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
}

.manual-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.manual-invoice-body label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5563;
}

.manual-invoice-body input[type="text"],
.manual-invoice-body input[type="number"],
.manual-invoice-body input[type="date"],
.manual-invoice-body select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.manual-item-row {
  display: grid;
  grid-template-columns: 3fr 0.7fr 0.9fr 0.9fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.manual-item-row input {
  width: 100%;
}

.manual-item-row-remove {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #9ca3af;
}

.manual-item-row-remove:hover {
  color: #ef4444;
}


/* === Dark Theme Override basierend auf Etsy Produkt – Preisrechner === */

:root {
  --bg: #070b10;
  --bg-elevated: #0f172a;
  --bg-elevated-2: #020617;
  --card-bg: #0f172a;
  --border-subtle: rgba(148, 163, 184, 0.4);
  --border: rgba(148, 163, 184, 0.45);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --danger: #f97373;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
}

/* Seitenhintergrund & Grundlayout */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  background: radial-gradient(circle at top left, #1e293b 0, #020617 45%, #000 100%);
  color: var(--text-main);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Kopfzeile wie beim Preisrechner-Topbar */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(to right, rgba(15,23,42,0.98), rgba(15,23,42,0.88));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(18px);
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header h1 span.logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #38bdf8, #0ea5e9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0b1120;
  font-weight: 700;
}

/* Hauptbereich & Karten */

main {
  width: 100%;
  max-width: 1220px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem;
}

.card {
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  border-radius: 1.4rem;
  padding: 1.3rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.card-header h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-header .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Inputs */

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text-main);
  font-size: 0.88rem;
}

/* Explicit styling for Umsatzsteuer combobox to avoid white-on-white issues */
#company-vat-liable {
  background: #020617 !important;
  color: var(--text-main) !important;
}


textarea {
  border-radius: 0.9rem;
  min-height: 64px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background: radial-gradient(circle at top left, rgba(15,23,42,1), rgba(15,23,42,0.98));
}

/* Badge & Status */

.badge,
.status-text {
  color: var(--text-muted);
}

/* Buttons im Preisrechner-Stil */

.btn {
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
}

.btn-primary,
.btn:not(.btn-secondary):not(.btn-danger) {
  background: radial-gradient(circle at top left, #38bdf8, #0ea5e9);
  color: #0b1120;
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover,
.btn:not(.btn-secondary):not(.btn-danger):hover {
  box-shadow: 0 18px 35px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 1);
}

/* Tabellen */

.orders-card .orders-table-wrapper {
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.orders-table thead {
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-muted);
}

.orders-table td,
.orders-table th {
  border-color: rgba(30, 64, 175, 0.4);
}

/* Modale Hintergründe leicht abdunkeln */

.invoice-modal-backdrop {
  background: rgba(15, 23, 42, 0.75);
}

#vat-config-modal .invoice-modal-content,
#manual-invoice-modal .invoice-modal-content {
  background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

#vat-config-modal .invoice-modal-header,
#manual-invoice-modal .invoice-modal-header {
  color: var(--text-main);
}


input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  color: #fff !important;
}


/* === Dark Table Overrides für Bestellungen & Steuersätze === */

.orders-table-wrapper {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.4);
}

.orders-table thead,
#vat-config-modal thead {
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-muted);
}

.orders-table th,
.orders-table td,
#vat-config-modal th,
#vat-config-modal td {
  border-bottom: 1px solid rgba(30, 64, 175, 0.45);
  background: transparent;
  color: var(--text-main);
}

.orders-table tbody tr:nth-child(even),
.orders-table tbody tr:nth-child(odd),
#vat-config-modal tbody tr:nth-child(even),
#vat-config-modal tbody tr:nth-child(odd) {
  background: transparent;
}

.orders-table tbody tr:hover,
#vat-config-modal tbody tr:hover {
  background: rgba(15, 23, 42, 0.9);
}



/* === FORCE DARK THEME OVERRIDES (NO WHITE BACKGROUNDS) === */

.orders-table-wrapper,
#vat-config-modal,
#vat-config-modal table,
.orders-table,
.orders-table * {
    background: rgba(15, 23, 42, 0.85) !important;
}

.orders-table thead th,
#vat-config-modal thead th {
    background: rgba(15,23,42,0.85) !important;
    color: #cbd5e1 !important;
}

.orders-table tbody tr,
#vat-config-modal tbody tr {
    background: rgba(255,255,255,0.03) !important;
}

.orders-table tbody tr:hover,
#vat-config-modal tbody tr:hover {
    background: rgba(255,255,255,0.06) !important;
}

.orders-table td,
.orders-table th,
#vat-config-modal td,
#vat-config-modal th {
    border-color: rgba(255,255,255,0.15) !important;
    color: #fff !important;
}



/* === UNIVERSAL DARK MODE FIX (NO WHITE FIELDS ANYWHERE) === */

/* All standard form controls */
input,
textarea,
select {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Autofill background in WebKit */
input:-webkit-autofill {
    box-shadow: 0 0 0px 1000px #0f172a inset !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* File inputs */
input[type="file"] {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
}

/* Chrome/Edge/Safari file upload button */
input[type="file"]::-webkit-file-upload-button {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 6px 14px !important;
    cursor: pointer;
}

/* Firefox file upload button */
input[type="file"]::file-selector-button {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 6px 14px !important;
    cursor: pointer;
}

/* Remove white artifacts in search fields */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none !important;
    appearance: none !important;
}


    /* Company VAT select + button layout */
    #company-vat-liable {
      width: 100%;
    }

    .company-vat-config-btn {
      margin-top: 6px;
      width: 100%;
      justify-content: center;
    }

    /* Custom look for logo file input + hint */
    .file-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    #company-logo {
      max-width: 220px;
    }

    #company-logo-hint.file-hint {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    /* Hide default file-name text but keep the native button readable */
    input[type="file"] {
      color: transparent;
    }
    input[type="file"]::-webkit-file-upload-button {
      color: var(--text-main);
    }
    input[type="file"]::file-selector-button {
      color: var(--text-main);
    }

    .company-buttons-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }



    .company-logo-preview img {
      max-height: 48px;
      border-radius: 6px;
      display: block;
    }



    /* Global UI polish for v2.1.8 */
    body {
      font-size: 15px;
    }

    main {
      padding: 24px;
      gap: 24px;
    }

    .card {
      border-radius: 18px;
      padding: 18px 18px 16px;
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.55);
      border: 1px solid rgba(148, 163, 184, 0.45);
      background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.35), rgba(15, 23, 42, 0.96));
    }

    .card-header h2 {
      font-size: 1.1rem;
      letter-spacing: 0.01em;
    }

    .card-header p {
      font-size: 0.88rem;
    }

    .field-row label {
      font-weight: 500;
      letter-spacing: 0.01em;
    }

    .btn {
      border-radius: 999px;
      font-size: 0.9rem;
    }

    .btn-primary {
      box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
    }

    .orders-table thead th {
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .orders-table td {
      font-size: 0.86rem;
    }

    .orders-search-row input {
      font-size: 0.9rem;
    }

    header {
      background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.9));
      border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    }

    header h1,
    header h1 span,
    header p {
      color: #e5e7eb;
    }

    header p {
      opacity: 0.9;
    }

    body {
      background: radial-gradient(circle at top left, #020617 0, #020617 40%, #020617 100%);
    }



    .subtitle {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      font-size: 0.9rem;
    }

    .version-pill {
      padding: 3px 10px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.35);
      border: 1px solid rgba(148, 163, 184, 0.7);
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #e5e7eb;
    }



    /* === v2.2.0 Dark Minimal (Linear-style) theme overrides === */

    :root {
      --bg: #050816;
      --card-bg: #050816;
      --border: #1f2937;
      --accent: #3b82f6;
      --accent-soft: rgba(59, 130, 246, 0.12);
      --text-main: #e5e7eb;
      --text-muted: #94a3b8;
      --danger: #f97373;
      --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
    }

    body {
      background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
      color: var(--text-main);
      font-size: 15px;
    }

    header {
      padding: 18px 28px;
      background: #020617;
      border-bottom: 1px solid #111827;
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    }

    header h1 {
      font-size: 1.4rem;
      letter-spacing: 0.03em;
    }

    .subtitle {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      font-size: 0.9rem;
      color: var(--text-muted);
    }

    .version-pill {
      padding: 3px 10px;
      border-radius: 999px;
      background: #020617;
      border: 1px solid #1f2937;
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
    }

    main {
      flex: 1;
      min-height: 0;
      padding: 24px 28px;
      gap: 24px;
    }

    .card {
      background: #020617;
      border-radius: 14px;
      border: 1px solid #111827;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
      padding: 18px 18px 16px;
    }

    .card-header {
      margin-bottom: 14px;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(31, 41, 55, 0.8);
    }

    .card-header h2 {
      font-size: 1.05rem;
      letter-spacing: 0.02em;
    }

    .card-header p {
      font-size: 0.86rem;
      color: var(--text-muted);
    }

    .field-row label {
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: 0.02em;
    }

    input,
    textarea,
    select {
      background: #020617;
      color: var(--text-main);
      border-radius: 10px;
      border: 1px solid #111827;
    }

    input:focus,
    textarea:focus,
    select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.8);
    }

    .btn {
      border-radius: 999px;
      font-size: 0.9rem;
      letter-spacing: 0.02em;
      border: 1px solid transparent;
    }

    .btn-primary {
      background: linear-gradient(120deg, #3b82f6, #22c1c3);
      color: #0b1120;
      box-shadow: 0 14px 35px rgba(37, 99, 235, 0.6);
    }

    .btn-secondary {
      background: #020617;
      border-color: #1f2937;
      color: var(--text-muted);
    }

    .btn-secondary:hover {
      border-color: #3b82f6;
      color: var(--text-main);
    }

    .orders-table-wrapper {
      border-radius: 12px;
      border: 1px solid #111827;
      background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), #020617);
    }

    .orders-table {
      border-collapse: collapse;
    }

    .orders-table thead th {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      background: #020617;
    }

    .orders-table tbody tr {
      border-bottom: 1px solid #0f172a;
    }

    .orders-table tbody tr:nth-child(even) {
      background: rgba(15, 23, 42, 0.9);
    }

    .orders-table tbody tr:hover {
      background: rgba(30, 64, 175, 0.4);
    }

    .orders-search-row input {
      background: #020617;
      border-radius: 999px;
      border: 1px solid #111827;
    }

    .badge {
      border-radius: 999px;
      background: rgba(31, 41, 55, 0.85);
      color: var(--text-muted);
      border: 1px solid #1f2937;
    }

    footer {
      border-top: 1px solid #111827;
      background: #020617;
      color: var(--text-muted);
    }

    /* Keep invoice container light-on-dark UI but white invoice */
    #invoice-modal .invoice-modal-content {
      background: rgba(15, 23, 42, 0.96);
    }


    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .help-modal-body {
      width: 900px;
      max-width: calc(100vw - 40px);
      max-height: calc(100vh - 140px);
      overflow: auto;
      padding: 16px 20px 20px;
      background: #020617;
      border-radius: 18px;
      box-shadow: 0 20px 60px rgba(15, 23, 42, 0.9);
      color: #e5e7eb;
      font-size: 0.9rem;
    }

    .help-section + .help-section {
      margin-top: 18px;
      border-top: 1px solid rgba(148, 163, 184, 0.35);
      padding-top: 14px;
    }

    .help-section h2 {
      font-size: 1.05rem;
      margin: 0 0 6px;
    }

    .help-section h3 {
      font-size: 0.95rem;
      margin: 10px 0 4px;
    }

    .help-section p {
      margin: 2px 0 6px;
      line-height: 1.45;
    }

    .help-figure {
      margin: 8px 0 4px;
      padding: 8px;
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.35);
    }

    .help-figure img {
      width: 100%;
      display: block;
      border-radius: 8px;
    }

    .help-figure figcaption {
      margin-top: 6px;
      font-size: 0.75rem;
      color: #9ca3af;
    }

    .help-figure-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 10px;
    }
