:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --text: #17212b;
  --muted: #687684;
  --line: #dde3e8;
  --accent: #176b5b;
  --danger: #a93434;
  --shadow: 0 8px 26px #1826320f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #15242a;
  color: #dce8e5;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  margin: 0 8px 28px;
}
.brand span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #3aa88e;
  color: #fff;
  font-weight: 800;
}
.brand strong {
  font-size: 17px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sidebar nav a,
.logout {
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: #b9cac6;
  text-decoration: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.expense-item {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 90px 90px minmax(150px, .8fr) 120px 40px;
    gap: 10px;
    align-items: end;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.expense-item .icon-button { height: 42px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.detail-grid span { display: block; color: var(--muted); font-size: 13px; }
.detail-grid strong { display: block; margin-top: 4px; }
.trip-preview { padding: 14px; border-radius: 9px; background: #eef6f3; color: var(--accent); font-weight: 700; }
.ocr-panel { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf9; }
.ocr-status { color: var(--muted); font-size: 13px; flex: 1; }
.ocr-status.success { color: var(--accent); font-weight: 700; }
.ocr-status.error { color: var(--danger); font-weight: 700; }
.ocr-panel progress { width: 140px; accent-color: var(--accent); }
@media (max-width: 850px) { .expense-item { grid-template-columns: 1fr 1fr; } .expense-item label:first-child { grid-column: 1 / -1; } .detail-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { .ocr-panel { align-items: stretch; flex-direction: column; } .ocr-panel progress { width: 100%; } }
@media (max-width: 520px) { .expense-item, .detail-grid { grid-template-columns: 1fr; } .expense-item label:first-child { grid-column: auto; } }
.sidebar nav a:hover,
.sidebar nav a.active {
  background: #243a40;
  color: #fff;
}
.nav-label {
  margin: 22px 12px 6px;
  color: #718c87;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.logout {
  width: 100%;
  border-top: 1px solid #2a3e43;
  border-radius: 0;
  padding-top: 18px;
}
.topbar {
  height: 108px;
  padding: 28px 4vw 20px;
  background: #ffffffb3;
  border-bottom: 1px solid var(--line);
}
h1,
h2,
p {
  margin-top: 0;
}
.topbar h1 {
  margin: 2px 0 0;
  font-size: 27px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.content {
  padding: 30px 4vw 60px;
  max-width: 1380px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.dashboard-section { margin-top: 44px; }
.dashboard-section h2 { margin: 0 0 18px; font-size: 18px; }
.dashboard-section .stats { margin-bottom: 10px; }
.dashboard-section-note { color: var(--muted); font-size: 13px; }
.stat,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.stat {
  padding: 22px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-weight: 600;
}
.stat strong {
  display: block;
  font-size: 34px;
  margin-top: 8px;
}
.card {
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 18px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.card-head h2 {
  margin-bottom: 4px;
}
.address-head-actions {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.address-head-actions .button {
  display: inline-flex;
  align-items: center;
}
.card-head p,
.muted {
  color: var(--muted);
  margin-bottom: 0;
}
.empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 6px;
}
.empty strong {
  color: var(--text);
  font-size: 17px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.invoice-data-card {
  padding-top: 16px;
  padding-bottom: 16px;
  margin-bottom: 14px;
}
.invoice-data-card h2 {
  margin-bottom: 12px;
}
.invoice-data-card .form-grid {
  row-gap: 12px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.field-with-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.field-with-action input { min-width: 0; }
.field-with-action .button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.expense-details-grid { gap: 12px 18px; }
.expense-payment-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.expense-more {
  padding-top: 2px;
  color: var(--muted);
}
.expense-more summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
}
.expense-more[open] summary { margin-bottom: 12px; }
.expense-suggestion { color: var(--muted); font-size: .78rem; font-weight: 500; }
.processing-state { align-items: center; display: inline-flex; gap: 7px; white-space: nowrap; }
.processing-dot { background: #2f9e66; border-radius: 50%; display: inline-block; height: 9px; width: 9px; }
.processing-state.needs-review .processing-dot { background: #d64545; }
.expense-work-summary { display: flex; max-width: 430px; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 16px 18px; }
.expense-work-summary h2 { margin: 0 0 4px; font-size: 1rem; }
.expense-work-summary-count { display: block; color: #b42318; font-size: 1.75rem; line-height: 1.05; }
.expense-work-summary small { display: block; margin-top: 5px; color: var(--muted); }
.expense-work-summary.is-clear .expense-work-summary-count { color: #18734a; font-size: 1.15rem; }
.expense-work-summary .button { flex: 0 0 auto; white-space: nowrap; }
.expense-work-summary .button.disabled { pointer-events: none; opacity: .55; }
@media(max-width:520px){.expense-work-summary{max-width:none;align-items:flex-start;flex-direction:column}.expense-work-summary .button{width:100%}}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #33414b;
  font-weight: 650;
}
label > span,
label small {
  font-weight: 400;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd4da;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #687684 50%),
    linear-gradient(135deg, #687684 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #176b5b1f;
  border-color: var(--accent);
}
/* Shared field contrast; native toggles and input buttons keep their styling. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="button"], [type="submit"], [type="reset"], [type="image"], [type="color"]), select, textarea):not(:focus) {
  border-color: #aab9c1;
  box-shadow: 0 1px 3px rgba(23, 43, 40, .07);
}
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="button"], [type="submit"], [type="reset"], [type="image"], [type="color"]), select, textarea):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, .15), 0 1px 3px rgba(23, 43, 40, .07);
}
textarea {
  resize: vertical;
}
.check {
  flex-direction: row;
  align-items: center;
  align-self: end;
  min-height: 43px;
}
.check input {
  width: 18px;
  height: 18px;
}
.shipping-address-choice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.shipping-address-choice .check {
  align-self: center;
}
.shipping-address-copy {
  min-height: 43px;
  line-height: 1.08;
  text-align: center;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.month-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
}
.month-toolbar form {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.month-toolbar label {
  display: block;
  margin: 0;
}
.month-toolbar input[type="month"],
.month-toolbar .button {
  height: 42px;
  box-sizing: border-box;
}
.month-toolbar input[type="month"] {
  width: 180px;
}
.month-toolbar .month-arrow {
  width: 42px;
  flex: 0 0 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.month-toolbar .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.align-start {
  align-self: flex-start;
}
.alert {
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.alert.success {
  background: #e8f5ef;
  color: #176044;
}
.alert.error {
  background: #fbecec;
  color: var(--danger);
}
.field-error {
  color: var(--danger) !important;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.narrow {
  max-width: 680px;
}
.method {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.method div span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.badge {
  background: #edf0f2;
  color: #69747b;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.badge.on {
  background: #e8f3f0;
  color: var(--accent);
}
code {
  background: #eef1f3;
  padding: 2px 5px;
  border-radius: 4px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, #dcefe9, transparent 38%), var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  padding: 36px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px #1826321f;
}
.auth-brand {
  color: var(--text);
  margin: 0 0 34px;
}
.auth-card h1 {
  font-size: 27px;
  margin-bottom: 5px;
}
.auth-card .muted {
  margin-bottom: 25px;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-label {
    grid-column: 1/-1;
  }
  .content {
    padding: 20px;
  }
  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .field-with-action { flex-wrap: wrap; }
  .field-with-action .button { width: 100%; }
  .method {
    grid-template-columns: 1fr auto;
  }
  .month-toolbar {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 5px;
  }
  .month-toolbar form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    min-width: 0;
  }
  .month-toolbar label,
  .month-toolbar input[type="month"] {
    width: 100%;
    min-width: 0;
  }
  .month-toolbar .month-arrow {
    width: 38px;
    flex-basis: 38px;
  }
  .month-toolbar form .button {
    padding-right: 10px;
    padding-left: 10px;
  }
}
.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.assignment-status { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: .82rem; font-weight: 700; text-decoration: none; }
.assignment-status.complete { color: #166534; background: #dcfce7; }
.assignment-status.partial { color: #92400e; background: #fef3c7; }
.assignment-status.open { color: #4b5563; background: #f3f4f6; }
.credit-notes-overview-table { min-width: 1180px; }
.credit-notes-overview-table th:first-child,.credit-notes-overview-table td:first-child { width: 145px; text-align: left; }
.credit-notes-overview-table th:nth-child(2),.credit-notes-overview-table td:nth-child(2) { width: 155px; }
.credit-notes-overview-table th:nth-child(4),.credit-notes-overview-table td:nth-child(4) { width: 100px; white-space: nowrap; }
.credit-notes-overview-table th:nth-child(5),.credit-notes-overview-table td:nth-child(5),.credit-notes-overview-table th:nth-child(6),.credit-notes-overview-table td:nth-child(6),.credit-notes-overview-table th:nth-child(7),.credit-notes-overview-table td:nth-child(7) { width: 120px; text-align: right; white-space: nowrap; }
.credit-notes-overview-table th:nth-child(8),.credit-notes-overview-table td:nth-child(8) { width: 170px; }
.credit-notes-overview-table th:last-child,.credit-notes-overview-table td:last-child { width: 180px; }
.credit-notes-overview-table .credit-notes-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.filterbar {
  display: flex;
  gap: 10px;
  margin-right: auto;
  flex-wrap: wrap;
}
.filterbar input,
.filterbar select {
  flex: 1 1 150px;
}
.datev-account-field { position: relative; }
.datev-account-suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.datev-account-suggestions:empty { display: none; }
.datev-account-suggestions button { display: block; width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: inherit; text-align: left; cursor: pointer; }
.datev-account-suggestions button:hover,.datev-account-suggestions button:focus { background: #f2f7f6; }
.transaction-search-table { table-layout: fixed; }
.transaction-search-table.transaction-search-table th:nth-child(1),.transaction-search-table.transaction-search-table td:nth-child(1) { width: 108px; min-width: 108px; padding-right: 18px; white-space: nowrap; }
.transaction-search-table.transaction-search-table th:nth-child(2),.transaction-search-table.transaction-search-table td:nth-child(2) { width: 100px; min-width: 100px; padding-left: 14px; padding-right: 18px; white-space: nowrap; }
.transaction-search-table th:nth-child(4),.transaction-search-table td:nth-child(4) { width: 110px; }
.transaction-search-table th:nth-child(5),.transaction-search-table td:nth-child(5) { width: 145px; padding-right: 24px; }
.transaction-search-table th:nth-child(6),.transaction-search-table td:nth-child(6) { width: 250px; padding-left: 18px; }
.transaction-search-table td:nth-child(3) { overflow-wrap: anywhere; }
.transaction-allocation-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.transaction-allocation-amount { flex: 0 0 88px; width: 88px; min-width: 0; }
.transaction-allocation-form .button { flex: 0 0 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.transaction-allocation-note { flex: 1 1 100%; min-width: 0; }
.invoice-payment-filter { display: grid; grid-template-columns: 155px 145px minmax(220px,1fr) 110px auto; align-items: center; gap: 8px; width: 100%; margin: 0 0 16px; }
.invoice-payment-filter input,.invoice-payment-filter select { width: 100%; min-width: 0; }
.invoice-payment-filter .button { white-space: nowrap; }
.credit-refund-filter { grid-template-columns: 170px 155px minmax(240px,1fr) auto; }
.invoice-payment-table-wrap { overflow-x: visible; }
.invoice-payment-table { width: 100%; min-width: 0; table-layout: fixed; }
.invoice-payment-table th,.invoice-payment-table td { min-width: 0; vertical-align: top; }
.invoice-payment-table th:nth-child(5) { padding-right: 18px; }
.invoice-payment-table th:nth-child(6) { padding-left: 18px; }
.invoice-payment-review { border-color: #c77b28; }
.invoice-payment-review p { margin: 8px 0; }
.invoice-payment-col-date { width: 145px; }
.invoice-payment-col-party { width: 185px; }
.invoice-payment-col-description { width: auto; }
.invoice-payment-col-amount { width: 85px; }
.invoice-payment-col-available { width: 90px; }
.invoice-payment-col-allocation { width: 345px; }
.invoice-payment-date strong,.invoice-payment-date span,.invoice-payment-description small { display: block; }
.invoice-payment-date { white-space: nowrap; }
.invoice-payment-date span,.invoice-payment-description small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.invoice-payment-party,.invoice-payment-description { overflow-wrap: anywhere; word-break: normal; }
.invoice-payment-money { white-space: nowrap; }
.invoice-payment-allocation { display: grid; grid-template-columns: 95px minmax(105px,1fr) auto; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.invoice-payment-amount { width: 95px; min-width: 0; }
.invoice-payment-note { width: 100%; min-width: 0; }
.invoice-payment-allocation .button { white-space: nowrap; padding-left: 8px; padding-right: 8px; font-size: 13px; }
.credit-refund-table th:first-child,.credit-refund-table td:first-child { width: auto; text-align: left; }
.credit-refund-table .credit-refund-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
@media(max-width:1250px){.invoice-payment-col-allocation{width:270px}.invoice-payment-allocation{grid-template-columns:90px minmax(0,1fr)}.invoice-payment-allocation .button{grid-column:1/-1;justify-self:end}.invoice-payment-amount{width:90px}}
@media(max-width:1100px){.invoice-payment-filter{grid-template-columns:145px 145px minmax(180px,1fr) 100px auto}.invoice-payment-table-wrap{overflow-x:auto}.invoice-payment-table{min-width:980px}}
@media(max-width:1100px){.credit-refund-filter{grid-template-columns:145px 145px minmax(180px,1fr) auto}}
@media(max-width:680px){.invoice-payment-filter{display:flex;flex-wrap:wrap}.invoice-payment-filter input,.invoice-payment-filter select{flex:1 1 145px}.invoice-payment-filter .button{flex:0 0 auto}.credit-refund-search{padding-left:14px;padding-right:14px}}
.discount-entry { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fa; }
.discount-entry > summary { display: inline-block; cursor: pointer; list-style: none; }
.discount-entry[open] > summary { margin-bottom: 16px; }
.discount-entry form { max-width: 620px; }
.discount-preview { margin: 14px 0; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap table { table-layout: fixed; min-width: 860px; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(1),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(1) { width: 82px; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(2),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(2) { width: 165px; white-space: normal; overflow-wrap: anywhere; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(3),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(3) { width: 170px; white-space: nowrap; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(4),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(4) { width: 110px; white-space: normal; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(5),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(5) { width: 100px; text-align: right; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(6),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(6) { width: 115px; white-space: normal; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(7),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(7) { width: 115px; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap th:nth-child(8),.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(8) { width: 135px; }
.content:has(.filterbar select[name="processing_status"]) .table-wrap td:nth-child(2) a { white-space: normal; overflow-wrap: anywhere; }
.transactions-overview-table { table-layout: fixed; min-width: 875px; }
.transactions-overview-table.transactions-overview-table th:nth-child(1),.transactions-overview-table.transactions-overview-table td:nth-child(1) { width: 140px; white-space: nowrap; text-align: left; }
.transactions-overview-table th:nth-child(2),.transactions-overview-table td:nth-child(2),.transactions-overview-table th:nth-child(4),.transactions-overview-table td:nth-child(4) { white-space: normal; overflow-wrap: anywhere; }
.transactions-overview-table th:nth-child(3),.transactions-overview-table td:nth-child(3) { width: 145px; white-space: normal; overflow-wrap: anywhere; }
.transactions-overview-table th:nth-child(5),.transactions-overview-table td:nth-child(5) { width: 75px; }
.transactions-overview-table th:nth-child(6),.transactions-overview-table td:nth-child(6) { width: 105px; white-space: normal; }
.transactions-overview-table th:nth-child(7),.transactions-overview-table td:nth-child(7) { width: 155px; text-align: right; white-space: normal; }
.transactions-overview-table th:last-child,.transactions-overview-table td:last-child { width: 155px; }
.transactions-overview-table .transaction-amount > strong { display: inline-block; font-weight: 750; }
.transaction-paypal-breakdown { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.transactions-overview-table .transaction-available { display: block; margin-top: 3px; }
.transaction-available { color: #1d4d43; font-size: .84rem; font-weight: 700; }
.transaction-import-accordion { padding: 0; overflow: visible; }
.transaction-import-accordion > summary { display: flex; align-items: center; gap: 10px; padding: 17px 20px; cursor: pointer; list-style: none; font-weight: 700; }
.transaction-import-accordion > summary::-webkit-details-marker { display: none; }
.transaction-import-accordion > summary::before { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; transition: transform .16s ease; }
.transaction-import-accordion[open] > summary::before { transform: rotate(90deg); }
.transaction-import-content { padding: 0 20px 20px; }
.transaction-import-content > p { margin: 0 0 16px; color: var(--muted); }
.transaction-import-content .alert { margin-bottom: 16px; }
.transactions-overview-table .transaction-assignment-open,.transactions-overview-table .transaction-assignment-complete,.transactions-overview-table .transaction-assignment-over { display: block; margin-top: 4px; font-size: .84rem; font-weight: 750; white-space: normal; }
.transactions-overview-table .transaction-assignment-open,.transactions-overview-table .transaction-assignment-over { color: #b42318; }
.transactions-overview-table .transaction-assignment-complete { color: #18734a; }
.transactions-overview-table .transaction-bank-deposit { display: inline-block; margin-top: 4px; color: #235d73; font-size: .82rem; font-weight: 700; }
.transaction-more-actions { margin-top: 6px; }
.transaction-more-actions > summary { color: var(--muted); cursor: pointer; font-size: .8rem; }
.transaction-more-actions[open] > summary { margin-bottom: 5px; }
.transaction-remaining-sort { color: inherit; text-decoration: none; }
.transaction-remaining-sort:hover,.transaction-remaining-sort.active { color: var(--text); }
.transaction-remaining-sort .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width:680px){.transaction-import-accordion > summary{padding:15px 16px}.transaction-import-content{padding:0 16px 16px}}
.transaction-fully-allocated { color: #166534; display: inline-block; font-size: .84rem; font-weight: 700; white-space: normal; }
.transfer-overview-table,.transfer-match-table { table-layout: fixed; min-width: 980px; }
.transfer-overview-table th:first-child,.transfer-overview-table td:first-child,.transfer-match-table th:first-child,.transfer-match-table td:first-child { width: 135px; white-space: nowrap; }
.transfer-overview-table th:nth-child(2),.transfer-overview-table td:nth-child(2),.transfer-match-table th:nth-child(2),.transfer-match-table td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
.transfer-overview-table th:nth-child(3),.transfer-overview-table td:nth-child(3),.transfer-match-table th:nth-child(3),.transfer-match-table td:nth-child(3) { width: 150px; white-space: normal; overflow-wrap: anywhere; }
.transfer-overview-table .amount-cell,.transfer-match-table .amount-cell { width: 110px; text-align: right; white-space: nowrap; }
.transfer-overview-table th:nth-child(6),.transfer-overview-table td:nth-child(6) { width: 150px; }
.transfer-overview-table th:last-child,.transfer-overview-table td:last-child { width: 185px; }
.transfer-match-table th:last-child,.transfer-match-table td:last-child { width: 230px; }
.transfer-allocation-form { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.transfer-allocation-form input[name="transfer_amount"] { flex: 0 0 88px; width: 88px; min-width: 0; }
.transfer-allocation-form input[name="note"] { flex: 1 1 100%; min-width: 0; }
.transfer-allocation-form .button { flex: 0 0 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.transaction-date { white-space: nowrap; }
.transaction-source { color: var(--muted); font-size: 12px; }
.transaction-status { display: inline-block; white-space: nowrap; }
.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: end;
}
.invoice-overview-filters {
  padding: 0;
  overflow: visible;
}
.invoice-overview-filters > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.invoice-overview-filters > summary::-webkit-details-marker {
  display: none;
}
.invoice-overview-filters > summary::before {
  content: "›";
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .16s ease;
}
.invoice-overview-filters[open] > summary::before {
  transform: rotate(90deg);
}
.invoice-overview-filters > summary small {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef1f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.invoice-overview-filters > .filter-grid {
  padding: 0 20px 20px;
}
.invoice-list-table .invoice-status {
  font-weight: 700;
}
.invoice-list-table .invoice-status--success {
  color: #18734a;
}
.invoice-list-table .invoice-status--danger {
  color: #b42318;
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fa;
  font-size: 13px;
}
.bulk-actions[hidden] {
  display: none;
}
.bulk-actions .button {
  padding: 7px 10px;
}
.bulk-actions .batch-pdf-button {
  min-width: 86px;
  line-height: 1.08;
  text-align: center;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  width: 32px;
  text-align: center;
}
.table-wrap .transfer-overview-table { min-width: 900px; }
.table-wrap .transfer-overview-table th:first-child,
.table-wrap .transfer-overview-table td:first-child { width: 135px; text-align: left; white-space: nowrap; }
.table-wrap .transfer-overview-table th:nth-child(2),
.table-wrap .transfer-overview-table td:nth-child(2) { width: auto; min-width: 190px; white-space: normal; overflow-wrap: anywhere; }
.table-wrap .transfer-overview-table th:nth-child(3),
.table-wrap .transfer-overview-table td:nth-child(3) { width: 130px; white-space: normal; overflow-wrap: anywhere; }
.table-wrap .transfer-overview-table th:nth-child(4),
.table-wrap .transfer-overview-table td:nth-child(4) { width: 300px; text-align: left; white-space: normal; }
.table-wrap .transfer-overview-table th:nth-child(5),
.table-wrap .transfer-overview-table td:nth-child(5) { width: 135px; white-space: normal; }
.table-wrap .transfer-overview-table th:last-child,
.table-wrap .transfer-overview-table td:last-child { width: 180px; }
.table-wrap .transfer-overview-table td:last-child .button { width: 100%; white-space: normal; }
.table-wrap .transfer-match-table { min-width: 1030px; }
.table-wrap .transfer-match-table th:first-child,
.table-wrap .transfer-match-table td:first-child { width: 215px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.transfer-match-identification > strong,
.transfer-match-identification > span,
.transfer-match-identification > small { display: block; }
.transfer-match-identification > strong { margin-bottom: 4px; }
.transfer-match-identification > span { margin-bottom: 5px; }
.transfer-match-identification > small { color: var(--muted); font-size: 12px; }
.table-wrap {
  overflow: auto;
}
.products-page { width: 100%; }
main:has(.products-page) .content { max-width: 1760px; padding-left: 30px; padding-right: 30px; }
.products-page > .page-actions { justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
.products-page > .page-actions > .filterbar { flex: 0 1 430px; min-width: 270px; margin-right: 8px; gap: 6px; flex-wrap: nowrap; }
.products-page > .page-actions > .filterbar input { min-width: 150px; }
.products-page > .page-actions > .row-actions { gap: 5px; flex: 0 1 auto; }
.products-page > .page-actions > .row-actions form { gap: 5px; }
.products-page > .page-actions > .row-actions select { min-width: 118px; }
.products-page > .page-actions .button,
.products-page > .page-actions select { padding-top: 8px; padding-bottom: 8px; }
.products-table-card { width: 100%; max-width: none; }
.products-table-card .table-wrap { overflow-x: visible; }
.products-table-card .data-table { width: 100%; min-width: 0; table-layout: fixed; }
.products-table-card th,
.products-table-card td { padding: 10px 6px; overflow-wrap: anywhere; }
.products-table-card th:nth-child(1),.products-table-card td:nth-child(1) { width: 38px; text-align: center; }
.products-table-card th:nth-child(2),.products-table-card td:nth-child(2) { width: 92px; }
.products-table-card th:nth-child(4),.products-table-card td:nth-child(4) { width: 125px; white-space: normal; }
.products-table-card th:nth-child(5),.products-table-card td:nth-child(5) { width: 68px; text-align: center; }
.products-table-card th:nth-child(6),.products-table-card td:nth-child(6) { width: 92px; text-align: right; }
.products-table-card th:nth-child(7),.products-table-card td:nth-child(7) { width: 62px; text-align: right; }
.products-table-card th:nth-child(8),.products-table-card td:nth-child(8) { width: 66px; }
.products-table-card th:nth-child(9),.products-table-card td.row-actions { width: 178px; }
.products-table-card td:nth-child(3) { white-space: normal; }
.products-table-card .table-note { max-width: none; font-size: 11px; line-height: 1.25; white-space: normal; }
.products-table-card .row-actions { justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; gap: 5px; }
.products-table-card .select-column { min-width: 0; white-space: normal; }
.products-table-card .select-column label { display: block; font-size: 0; cursor: pointer; }
.products-table-card .select-column input { width: 17px; height: 17px; padding: 0; }
.bulk-edit-card { margin-bottom: 14px; padding: 14px 16px; }
.bulk-edit-card .card-head { align-items: center; margin-bottom: 10px; gap: 12px; }
.bulk-edit-card .card-head h2 { font-size: 17px; margin: 0 0 2px; }
.bulk-edit-card .card-head p { font-size: 12px; }
.bulk-edit-card .card-head .button { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; }
.bulk-edit-grid { display: grid; grid-template-columns: minmax(190px,1.25fr) 130px 145px minmax(315px,1.7fr); gap: 8px; align-items: end; }
.bulk-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bulk-field > span { display: flex; align-items: center; gap: 6px; color: #33414b; font-size: 12px; font-weight: 650; white-space: nowrap; }
.bulk-field > span input { flex: 0 0 auto; width: 16px; height: 16px; padding: 0; margin: 0; }
.bulk-field > select,.bulk-field > input { min-width: 0; height: 36px; padding-top: 7px; padding-bottom: 7px; }
.bulk-field:last-child { display: grid; grid-template-columns: minmax(180px,1fr) 112px; }
.bulk-field:last-child > span { grid-column: 1/-1; }
@media(max-width:1180px){.products-page > .page-actions{flex-wrap:wrap}.products-page > .page-actions > .filterbar{flex-basis:360px}.bulk-edit-grid{grid-template-columns:repeat(2,minmax(190px,1fr))}}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 13px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}
.pagination {
  display: flex;
  gap: 5px;
}
.pagination a {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
}
.pagination a.active {
  background: var(--accent);
  color: #fff;
}
.stat {
  text-decoration: none;
  color: inherit;
}
.invoice-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.invoice-item {
  display: grid;
  grid-template-columns: 70px 105px minmax(180px, 1fr) 105px 70px 90px 72px 36px 78px;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.invoice-item-head {
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 0;
}
.invoice-item .disabled {
  grid-column: 3/4;
  width: max-content;
}
.icon-button {
  border: 0;
  background: #f3e7e7;
  color: var(--danger);
  border-radius: 7px;
  font-size: 22px;
}
.invoice-item .select-product {
  padding: 8px 10px;
  white-space: nowrap;
}
.invoice-item .copy-position {
  background: #e8f2ef;
  color: #176b5b;
}
.invoice-item .remove-item {
  min-width: 36px;
}
.invoice-item .remove-item.confirm-delete {
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.totals {
  margin: 22px 0 0 auto;
  max-width: 400px;
  display: grid;
  gap: 8px;
}
.totals span {
  display: flex;
  justify-content: space-between;
}
.totals span:last-child {
  font-size: 19px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.sticky-save {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  padding: 14px;
  padding-right: 14px;
  pointer-events: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
}
.sticky-save .button { pointer-events: auto; }
.history {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}
.snapshot {
  white-space: pre-wrap;
  overflow: auto;
  background: #f1f4f5;
  padding: 18px;
  border-radius: 8px;
}
@media (max-width: 1100px) {
  .invoice-item {
    grid-template-columns: 65px 95px minmax(150px, 1fr) 95px 65px 72px 36px 78px;
  }
  .invoice-item output {
    display: none;
  }
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .invoice-overview-filters > summary {
    padding: 15px 16px;
  }
  .invoice-overview-filters > .filter-grid {
    grid-template-columns: 1fr;
    padding: 0 16px 16px;
  }
}
.clipboard-button {
  width: auto;
  margin: -40px 6px 0 auto;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: #eef2f3;
  cursor: pointer;
  z-index: 1;
}
.clipboard-error {
  color: var(--danger);
  font-size: 11px;
}
.historical {
  background: #fff2cc;
  color: #705400;
  border: 1px solid #ead58e;
}
.preline {
  white-space: pre-line;
}
.row-action {
  white-space: nowrap;
}
.shipping-inline {
  margin: 18px 0;
  padding: 18px;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.shipping-inline h2 {
  margin-bottom: 12px;
}
.customer-suggestions {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.customer-suggestions:empty {
  display: none;
}
.customer-suggestions button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.customer-suggestions button:hover,
.customer-suggestions button.is-active {
  background: #eef6f3;
}
.customer-suggestions button strong,
.customer-suggestions button small { display: block; }
.customer-suggestions button small { margin-top: 3px; color: var(--muted); }
.item-product-autocomplete { position: relative; display: block; min-width: 0; }
.item-product-autocomplete > input { width: 100%; }
.product-inline-results {
  position: absolute;
  z-index: 25;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
/* Only the SKU dropdown grows; its input and grid column retain their width. */
.item-product-autocomplete > input[name$="[sku]"] + .product-inline-results {
  width: 500px;
  max-width: calc(100vw - 24px);
  left: var(--sku-suggestions-left, 0px);
  right: auto;
}
.item-product-autocomplete > input[name$="[sku]"] + .product-inline-results strong { min-width: 0; overflow-wrap: anywhere; }
.item-product-autocomplete > input[name$="[sku]"] + .product-inline-results button > span { flex-shrink: 0; text-align: right; }
.product-inline-results:empty { display: none; }
.product-inline-results button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.product-inline-results button:hover,
.product-inline-results button.is-active { background: #eef6f3; }
.product-inline-results span { color: var(--muted); white-space: nowrap; }
.button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.scan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scan-actions form { margin: 0; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.scan-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.scan-thumbnail { display: grid; place-items: center; height: 220px; padding: 12px; overflow: hidden; background: #eef1f5; text-decoration: none; }
.scan-thumbnail canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 2px 10px rgba(20, 31, 47, .18); background: #fff; }
.scan-pdf-placeholder { display: grid; place-items: center; gap: 8px; color: var(--muted); text-align: center; }
.scan-thumbnail [hidden] { display: none !important; }
.scan-pdf-placeholder strong { display: grid; place-items: center; width: 68px; height: 84px; border-radius: 6px; background: #fff; color: var(--danger); box-shadow: 0 2px 10px rgba(20, 31, 47, .12); font-size: 20px; }
.scan-card-body { display: grid; gap: 12px; padding: 16px; }
.scan-file-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.scan-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--muted); font-size: .9rem; }
@media (max-width: 520px) { .scan-grid { grid-template-columns: 1fr; } .scan-actions > * { flex: 1 1 auto; } .scan-actions .button { width: 100%; } }
.cancellation-action { padding: 0; overflow: visible; border: 2px solid #b42318; }
.cancellation-action > summary { display: flex; align-items: center; gap: 10px; padding: 15px 18px; cursor: pointer; list-style: none; font-weight: 700; }
.cancellation-action > summary::-webkit-details-marker { display: none; }
.cancellation-action > summary::before { content: "›"; color: #b42318; font-size: 22px; line-height: 1; transition: transform .16s ease; }
.cancellation-action[open] > summary::before { transform: rotate(90deg); }
.cancellation-action-content { padding: 0 18px 18px; }
.cancellation-action-content > .form-actions { justify-content: flex-start; margin-top: 0; margin-bottom: 14px; }
.cancellation-action details > summary { display: inline-block; cursor: pointer; list-style: none; }
.cancellation-action form { margin-top: 18px; display: grid; gap: 14px; }
.customer-delete > summary { cursor: pointer; list-style: none; }
.customer-delete > form { margin-top: 12px; padding: 16px; border: 1px solid var(--danger); border-radius: 10px; background: #fff4f2; display: grid; gap: 12px; }
.customer-delete > form p { margin: 0; }
.cancellation-status { border-left: 6px solid #b42318; background: #fff4f2; }
.status-danger { display: block; margin-top: 3px; color: #b42318; font-weight: 700; }
.address-grid label {
  position: relative;
}
.document-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.document-actions form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}
#document-panel {
  padding: 14px 18px;
}
#document-panel h2 {
  display: inline-block;
  margin: 0 12px 8px 0;
  font-size: 18px;
}
#document-panel > .button {
  margin-top: 8px;
  padding: 7px 10px;
  font-size: 12px;
}
.document-actions label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.document-actions input[type="date"] {
  width: auto;
  padding: 7px 8px;
}
.document-actions .button {
  padding: 8px 11px;
  white-space: nowrap;
}
.mail-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mail-status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #aab3ba; }
.mail-status.sent { color: #18734a; font-weight: 700; }
.mail-status.sent .mail-status-dot { background: #2f9e66; }
.invoice-mail-detail { order: 2; margin-left: 2px; }
.document-address-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.invoice-list-table { table-layout: fixed; }
.invoice-list-table .invoice-mail-column { width: 90px; }
.invoice-list-table th:nth-child(2),.invoice-list-table td:nth-child(2) { width: 92px; }
.invoice-list-table th:nth-child(4),.invoice-list-table td:nth-child(4) { width: 92px; }
.invoice-list-table th:nth-child(5),.invoice-list-table td:nth-child(5) { width: 105px; }
.invoice-list-table th:nth-child(6),.invoice-list-table td:nth-child(6) { width: 105px; }
.invoice-list-table th:nth-child(7),.invoice-list-table td:nth-child(7) { width: 76px; }
.invoice-list-table th:nth-child(8),.invoice-list-table td:nth-child(8) { width: 118px; }
.invoice-list-table th:nth-child(10),.invoice-list-table td:nth-child(10) { width: 125px; }
.invoice-list-table th:last-child,.invoice-list-table td:last-child { width: 68px; }
.account-balance-date,
.account-balance-date form { display: flex; align-items: center; gap: 7px; }
.account-balance-date label { flex-direction: row; align-items: center; gap: 7px; white-space: nowrap; }
.account-balance-date input[type="date"],.account-balance-date .button { height: 40px; box-sizing: border-box; }
.account-balance-table { min-width: 1050px; }
.account-balance-table td:first-child { width: 250px; text-align: left; white-space: normal; }
.account-balance-table td:first-child small,.account-movement-table td:nth-child(2) small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; }
.account-balance-table th:nth-child(n+3):nth-child(-n+6),.account-balance-table td:nth-child(n+3):nth-child(-n+6),.account-movement-table th:nth-child(n+3),.account-movement-table td:nth-child(n+3) { text-align: right; }
.account-balance-table .row-actions { display: flex; gap: 6px; }
.account-balance-table .row-actions .button { padding: 7px 9px; white-space: normal; }
.money-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-balance-total { font-weight: 750; }
.balance-positive { color: #18734a; }
.balance-negative { color: #b42318; }
.balance-not-configured { color: #855b00; font-weight: 700; }
.account-movement-table { min-width: 760px; }
.account-movement-table td:nth-child(2) { white-space: normal; min-width: 240px; }
@media(max-width:680px){.account-balance-date,.account-balance-date form{flex-wrap:wrap}.account-balance-date form{width:100%}.account-balance-date label{flex:1 1 190px}.account-balance-date input[type="date"]{min-width:0;width:100%}.account-balance-page .card-head{align-items:flex-start;flex-direction:column}.account-balance-table .row-actions{flex-direction:column}}
.document-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 0;
}
.document-list .button {
  padding: 7px 10px;
  font-size: 12px;
}
.document-list details {
  margin: 0;
}
.document-list details summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.document-status {
  display: inline;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 760px) {
  .document-actions,
  .document-actions form {
    align-items: stretch;
    flex-direction: column;
  }
  .document-actions label {
    align-items: stretch;
    flex-direction: column;
  }
  .document-actions input[type="date"] {
    width: 100%;
  }
}
.suggestion-host,
.filterbar {
  position: relative;
}
.customer-suggestions a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: #fff;
}
.customer-suggestions a:hover { background: #eef6f3; }
.sort-link { color: inherit; text-decoration: none; }
.pagination { margin: 12px 0; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; }
.row-button { padding: 5px 9px; font-size: 13px; }
.destinations-table { min-width: 1080px; }
.destinations-table th:first-child,
.destinations-table td:first-child { width: auto; text-align: left; }
.destinations-table .destination-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 110px;
  min-width: 110px;
  text-align: right;
  background: #fff;
  box-shadow: -8px 0 10px -10px rgba(21, 36, 42, .65);
}
.destinations-table thead .destination-actions { z-index: 2; }
.tax-groups { display: grid; gap: 5px; padding-bottom: 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tax-groups > span { display: flex; justify-content: space-between; }
.list-controls { display: flex; justify-content: flex-end; align-items: end; gap: 18px; margin: 14px 0; }
.list-controls.bottom { margin-top: 16px; }
.per-page { display: flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.per-page label { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.per-page select { width: auto; min-width: 76px; }
.per-page .button { flex: 0 0 auto; }
.pagination.compact { justify-content: flex-end; align-items: center; margin: 0; }
.pagination.compact > span { padding: 7px 4px; white-space: nowrap; }
.pagination.compact .disabled { color: var(--muted); opacity: .65; }
.shipping-accordion { padding: 0; overflow: hidden; }
.shipping-accordion > summary { padding: 20px 24px; cursor: pointer; font-size: 18px; font-weight: 700; list-style-position: inside; }
.shipping-accordion[open] > summary { border-bottom: 1px solid var(--line); }
.shipping-accordion-body { padding: 20px 24px 24px; }
@media(max-width:680px){.list-controls{align-items:stretch;flex-direction:column}.pagination.compact{justify-content:space-between;width:100%}}
.mail-send fieldset { margin: 22px 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.mail-send legend { padding: 0 8px; font-weight: 750; }
.mail-send fieldset .check { margin-bottom: 8px; justify-content: flex-start; }
.table-note { display: block; max-width: 520px; margin-top: 3px; color: var(--muted); }
.settings-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.settings-card {
  display: block;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.settings-card:hover {
  border-color: var(--primary);
  box-shadow: 0 7px 18px #17212b14;
  transform: translateY(-1px);
}
.settings-card h2 {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 17px;
}
.settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.settings-section + .settings-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.settings-section > h2 {
  margin-bottom: 14px;
}
.muted-row { opacity: .65; }
.category-list { display: grid; gap: 10px; }
.category-row { display: flex; align-items: end; gap: 10px; }
.category-row > .category-form { flex: 1 1 auto; }
.category-row > form:last-child { flex: 0 0 auto; }
.category-form { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) 100px auto auto; gap: 10px; align-items: end; }
.expense-payment-method-form { display: grid; grid-template-columns: minmax(160px,1fr) minmax(130px,.8fr) minmax(120px,.7fr) 100px auto auto; gap: 10px; align-items: end; }
.category-form .check { align-self: center; }
.product-dialog { width: min(900px,calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 70px #16242f55; color: var(--text); }
.product-dialog::backdrop { background: #17212b99; }
.decision-dialog { width: min(560px,calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 14px; box-shadow: 0 24px 70px #16242f55; color: var(--text); }
.decision-dialog::backdrop { background: #17212b99; }
.decision-dialog h2 { margin-top: 0; }
.decision-dialog .form-actions { flex-wrap: wrap; }
.address-paste-dialog textarea { width: 100%; resize: vertical; }
.address-paste-preview { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fa; }
.address-paste-preview:empty { display: none; }
.address-paste-preview dl { display: grid; grid-template-columns: minmax(110px,.35fr) 1fr; gap: 6px 12px; margin: 0; }
.address-paste-preview dt { color: var(--muted); }
.address-paste-preview dd { margin: 0; overflow-wrap: anywhere; }
.product-dialog > * { padding-left: 24px; padding-right: 24px; }
.dialog-head,.dialog-subhead,.product-browser-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-head { position: sticky; top: 0; z-index: 3; padding-top: 20px; padding-bottom: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.dialog-head h2,.dialog-head p,.dialog-subhead h3 { margin: 0; }
.product-picker-view,.product-create-view { padding-top: 20px; padding-bottom: 24px; }
.product-results { position: absolute; z-index: 4; top: 100%; left: 0; right: 0; max-height: 330px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.product-results:empty { display: none; }
.product-results p { margin: 0; padding: 12px; }
.product-browser-head { margin: 22px 0 12px; }
.product-breadcrumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.product-breadcrumbs button { padding: 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; }
.product-browser { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.product-browser-uncategorized-title { grid-column: 1 / -1; margin: 8px 0 0; font-size: 14px; }
.category-result,.product-result { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; cursor: pointer; }
.category-result { color: var(--primary); font-weight: 750; }
.category-result::before { content: "Kategorie"; color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; }
.product-result:hover,.category-result:hover { border-color: var(--primary); background: #eef6f3; }
#product-picker .category-result { background: #e5f3ee; }
#product-picker .category-result::before { color: var(--accent); font-weight: 600; }
#product-picker .category-result:hover { background: #d6eae1; }
.product-result span { color: var(--muted); font-size: 12px; }
#product-picker .product-result .product-result-sku { color: #64748b; font-size: inherit; }
.product-results .product-result { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
@media(max-width:760px){.category-form,.expense-payment-method-form{grid-template-columns:1fr}.category-row{align-items:stretch;flex-direction:column}.product-browser{grid-template-columns:1fr}.product-browser-head,.dialog-subhead{align-items:stretch;flex-direction:column}}
.row-actions form { display: flex; gap: 8px; }
.row-actions select { width: auto; min-width: 145px; }
.import-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.import-summary > div { display: grid; gap: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fa; }
.import-summary strong { font-size: 24px; }
.import-summary span { color: var(--muted); }
.import-summary .has-errors,.import-error { background: #fff0ef; color: var(--danger); }
.table-scroll { overflow-x: auto; }
@media(max-width:760px){.import-summary{grid-template-columns:repeat(2,1fr)}}

.billing-address-main {
  margin-top: 18px;
}
.billing-more-toggle {
  margin: 12px 0 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.billing-more-toggle:hover,
.billing-more-toggle:focus-visible {
  text-decoration: underline;
}
.billing-address-optional {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.billing-address-optional[hidden] {
  display: none;
}
.totals {
  max-width: none;
  margin: 14px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.tax-groups {
  display: contents;
}
.totals > span,
.tax-groups > span {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fa;
  gap: 10px;
}
.totals > span:last-child {
  padding: 9px 11px;
  border: 2px solid var(--accent);
  font-size: 17px;
  background: #eef6f3;
}
.totals .tax-groups > span:last-child {
  padding: 9px 11px;
  border: 1px solid var(--line);
  font-size: inherit;
}
.totals strong,
.tax-groups strong {
  white-space: nowrap;
}
.shipping-inline {
  margin: 12px 0;
  padding: 14px;
}
.shipping-inline.shipping-accordion {
  padding: 0;
  overflow: hidden;
}
.shipping-inline.shipping-accordion > summary {
  padding: 14px;
}
.shipping-inline.shipping-accordion[open] > summary {
  border-bottom: 1px solid var(--line);
}
.shipping-inline .shipping-accordion-body {
  padding: 14px;
}
.shipping-inline .form-grid {
  gap: 12px 18px;
}
@media (max-width: 680px) {
  .expense-payment-row { grid-template-columns: 1fr; gap: 12px; }
  .totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .transaction-search-card .table-wrap { overflow: visible; }
  .transaction-search-table,
  .transaction-search-table tbody,
  .transaction-search-table tr,
  .transaction-search-table td { display: block; width: 100%; }
  .transaction-search-table thead { display: none; }
  .transaction-search-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .transaction-search-table td { padding: 4px 0; border: 0; }
  .transaction-search-table td:nth-child(1)::before { content: 'Datum: '; }
  .transaction-search-table td:nth-child(2)::before { content: 'Quelle: '; }
  .transaction-search-table td:nth-child(4)::before { content: 'Transaktion: '; }
  .transaction-search-table td:nth-child(5)::before { content: 'Noch zuzuordnen: '; }
  .transaction-search-table td:nth-child(6) { margin-top: 8px; }
  .transaction-allocation-form { max-width: 100%; }
}
@media (max-width: 430px) {
  .totals {
    grid-template-columns: 1fr;
  }
}

main:has([data-expense-form]) .content { max-width: 1740px; }
.expense-entry-layout { display: grid; grid-template-columns: minmax(620px,1.65fr) minmax(340px,1fr); gap: 22px; align-items: start; }
.expense-entry-main { min-width: 0; }
.expense-show-layout { display: grid; grid-template-columns: minmax(620px,1.65fr) minmax(340px,1fr); gap: 22px; align-items: start; }
.expense-show-layout.without-preview { grid-template-columns: minmax(0,1fr); }
.expense-show-main { min-width: 0; }
.expense-entry-main .card { padding: 18px 20px; margin-bottom: 16px; }
.expense-entry-main .card-head { margin-bottom: 12px; }
.expense-entry-main .expense-details-grid { grid-template-columns: minmax(210px,1.35fr) minmax(145px,.8fr) minmax(150px,.9fr); gap: 10px 14px; }
.expense-entry-main .expense-payment-row { grid-template-columns: minmax(180px,.8fr) minmax(165px,.75fr) minmax(180px,1fr); gap: 14px; }
.expense-entry-main input[type="file"] { max-width: 560px; }
.expense-entry-main [data-destination-wrap] { max-width: 580px; }
.expense-note-card textarea { min-height: 72px; resize: vertical; }
.expense-item { grid-template-columns: 82px 128px minmax(180px,1fr) 125px 40px; gap: 9px; align-items: end; padding: 9px 0; }
.expense-item .icon-button { margin-bottom: 0; }
.expense-field-invalid,[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 2px color-mix(in srgb,var(--danger) 18%,transparent); }
.expense-vat-message { margin: 12px 0 0; }
.expense-receipt-preview { position: sticky; top: 18px; min-width: 0; margin: 0; padding: 18px; }
.expense-receipt-preview .card-head { align-items: center; gap: 10px; }
.receipt-open-button { flex: 0 0 auto; padding: 7px 10px; white-space: nowrap; }
.receipt-open-button:disabled { cursor: not-allowed; opacity: .55; }
.receipt-preview-trigger { display: block; width: 100%; min-height: 380px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f3f6f7; cursor: zoom-in; }
.receipt-preview-trigger[hidden] { display: none; }
.receipt-preview-trigger > span { display: block; width: 100%; height: min(62vh,620px); }
.receipt-preview-trigger img { width: 100%; height: 100%; border: 0; object-fit: contain; pointer-events: none; }
.receipt-pdf-small { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; }
.receipt-pdf-small canvas { display: block; max-width: 100%; max-height: calc(100% - 30px); background: #fff; box-shadow: 0 2px 9px #16242f24; }
.receipt-pdf-note { color: var(--muted); font-size: .82rem; line-height: 1.2; }
.receipt-preview-empty { display: grid; min-height: 380px; place-items: center; padding: 24px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.receipt-preview-dialog { width: min(94vw,1500px); height: 92vh; padding: 0; border: 0; border-radius: 14px; color: var(--text); background: var(--surface,#fff); box-shadow: 0 24px 70px #16242f66; }
.receipt-preview-dialog::backdrop { background: #17212bcc; }
.receipt-preview-dialog-head { display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.receipt-preview-dialog-head h2 { margin: 0; }
.receipt-preview-large { height: calc(92vh - 58px); overflow-y: auto; padding: 12px; background: #eef2f3; }
.receipt-preview-large > img { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }
.receipt-pdf-pages { display: grid; justify-items: center; gap: 18px; width: 100%; }
.receipt-pdf-page { display: grid; justify-items: center; gap: 6px; width: 100%; }
.receipt-pdf-page canvas { display: block; max-width: 100%; background: #fff; box-shadow: 0 3px 14px #16242f33; }
.receipt-pdf-page-label { color: var(--muted); font-size: .82rem; }
@media (max-width: 1100px) { .expense-entry-layout,.expense-show-layout { grid-template-columns: 1fr; } .expense-receipt-preview { position: static; } .receipt-preview-trigger > span { height: min(70vh,650px); } }
@media (max-width: 760px) { .expense-entry-main .expense-details-grid,.expense-entry-main .expense-payment-row { grid-template-columns: 1fr; } .expense-item { grid-template-columns: 85px 125px minmax(150px,1fr) 105px 40px; overflow-x: auto; } .receipt-preview-trigger,.receipt-preview-empty { min-height: 260px; } }
@media (max-width: 520px) { .expense-item { grid-template-columns: 1fr 1fr; overflow: visible; } .expense-item label:nth-child(3) { grid-column: 1/-1; } .expense-item .icon-button { justify-self: end; } .receipt-preview-dialog { width: calc(100vw - 16px); height: 94vh; } .receipt-preview-large { height: calc(94vh - 58px); padding: 6px; } }
.paypal-fetch-form{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.paypal-fetch-form label{display:grid;gap:5px}.paypal-fetch-form input{width:auto}.paypal-connection-card .inline-form{margin-top:12px}.connection-status{padding:5px 9px;border-radius:999px;background:#e8f2ef;color:#1d5f50}.transactions-overview-table tr:has(.transaction-review-warning){background:#fff8e5}.transaction-review-warning{display:block;color:#8a5700;font-weight:700}
@media(max-width:520px){.paypal-fetch-form>*{width:100%}.paypal-fetch-form input,.paypal-fetch-form button{width:100%}}
