:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #dde4ee;
  --text: #1d2633;
  --muted: #667085;
  --blue: #2563eb;
  --green: #168a4a;
  --red: #b42318;
  --amber: #b76e00;
}

@font-face {
  font-family: "TH Sarabun New";
  src: url("/static/vendor/fonts/Sarabun-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TH Sarabun New";
  src: url("/static/vendor/fonts/Sarabun-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun New";
  src: url("/static/vendor/fonts/Sarabun-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun New";
  src: url("/static/vendor/fonts/Sarabun-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea,
table {
  font: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--bg);
  color: var(--text);
  font-family: "TH Sarabun New", "Sarabun New", "Sarabun", Tahoma, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.35;
}

.auth-body {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: var(--bg);
}

.auth-main {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
}

.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.auth-brand {
  margin-bottom: 22px;
  color: var(--text);
}

.auth-brand span {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-reset-form {
  display: grid;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.alert {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.alert.error {
  border: 1px solid #fda29b;
  background: #fff1f0;
  color: var(--red);
}

.alert.success {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: var(--green);
}

a {
  color: var(--blue);
  text-decoration: none;
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #111827;
  color: #fff;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: block;
  flex: 0 0 42px;
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #b8c1d1;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  color: #d7deea;
  border-radius: 8px;
  padding: 10px 12px;
}

nav a.active,
nav a:hover {
  background: #263142;
  color: #fff;
}

main {
  min-width: 0;
  padding: 28px;
}

.page-header,
.section-title,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.button.warning {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

.button.edit {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.small {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
}

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

.toolbar-search {
  width: min(320px, 42vw);
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric,
.form-panel,
.import-bar,
.detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  padding: 18px;
}

.metric span,
.detail-grid span,
label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.split,
.lookup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
  gap: 18px;
  margin-bottom: 22px;
}

.chart-panel {
  margin-bottom: 22px;
}

.chart-box {
  height: 270px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
}

.segmented-control button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
}

.segmented-control button.active {
  background: var(--blue);
  color: #fff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-wrap.compact {
  max-height: 420px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #f0f4f9;
  color: #344054;
  font-size: 13px;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

th[data-sort]::after {
  content: " ↕";
  color: #98a2b3;
  font-size: 12px;
}

th[data-sort].sorted[data-sort-dir="asc"]::after {
  content: " ↑";
  color: var(--blue);
}

th[data-sort].sorted[data-sort-dir="desc"]::after {
  content: " ↓";
  color: var(--blue);
}

tr:last-child td {
  border-bottom: 0;
}

.num {
  text-align: right;
}

.strong {
  font-weight: 700;
}

.pill {
  display: inline-flex;
  min-width: 70px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.s {
  background: #dcfce7;
  color: var(--green);
}

.pill.b {
  background: #fef3c7;
  color: var(--amber);
}

.pill.cancelled {
  background: #fee4e2;
  color: var(--red);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill.ready {
  background: #dcfce7;
  color: var(--green);
}

.status-pill.success {
  background: #dcfce7;
  color: var(--green);
}

.status-pill.pending {
  background: #fef3c7;
  color: var(--amber);
}

.status-pill.danger {
  background: #fee4e2;
  color: var(--red);
}

.pagination-row td {
  background: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.pagination .button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.inline-input {
  width: 150px;
  min-height: 30px;
  border-radius: 6px;
  font-size: 13px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.filters,
.import-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 150px 150px auto;
  gap: 10px;
  margin-bottom: 16px;
}

.import-bar {
  grid-template-columns: 150px minmax(220px, 1fr) auto;
  align-items: center;
  padding: 12px;
}

.filters.lookup-filters {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.filters.summary-filters {
  grid-template-columns: minmax(220px, 1fr) 160px auto;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.bulk-actions span,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.bulk-actions select {
  width: 210px;
}

.backup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-summary-wrap table {
  min-width: 1080px;
}

.account-summary-table th {
  border-right: 1px solid #b9c3d0;
  background: #d1d5db;
  color: #111827;
  text-align: center;
}

.account-summary-table td {
  border-right: 1px solid #d0d7e2;
}

.account-summary-table .income-col {
  background: #fde68a;
}

.account-summary-table th.income-col {
  background: #fbbf24;
}

.account-summary-table .summary-row td {
  background: #d1d5db;
  font-weight: 700;
}

.account-summary-table .summary-row .income-col {
  background: #fbbf24;
}

.account-summary-table .focus-row td {
  border-bottom: 1px solid #111827;
}

.limit-bar {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-left: 3px solid #f59e0b;
  background: #fff;
}

.limit-bar span {
  display: block;
  max-width: 100%;
  height: 100%;
  background: #16a34a;
}

.limit-bar.tiny {
  height: 16px;
}

.limit-bar.tiny span {
  background: #f59e0b;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
}

.form-panel {
  padding: 18px;
}

.form-error,
.form-success {
  margin: 0 0 14px;
  border-radius: 8px;
  padding: 10px 12px;
}

.form-error {
  border: 1px solid #fda29b;
  background: #fff1f0;
  color: var(--red);
}

.form-success {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: var(--green);
}

.form-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid.one {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.modal-items {
  margin-top: 16px;
}

.modal-total-fields {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.amount-suffix-field {
  width: min(280px, 100%);
}

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.input-suffix b {
  color: var(--text);
  font-weight: 700;
}

.modal-items-table {
  min-width: 680px;
}

.modal-items-table th:nth-child(1) {
  width: 42%;
}

.modal-items-table th:nth-child(2),
.modal-items-table th:nth-child(3),
.modal-items-table th:nth-child(4) {
  width: 16%;
}

.tax-party-panels {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.tax-party-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.detail-grid {
  margin-bottom: 18px;
}

.detail-grid > div {
  padding: 14px;
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.52);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.compact-modal {
  width: min(620px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tabs {
  display: grid;
  gap: 14px;
}

.tab-list {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.tab-button.active {
  border-bottom-color: var(--blue);
  color: var(--text);
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.bill-stage {
  overflow: auto;
  padding: 12px 0 32px;
}

.public-bill-body {
  display: block;
  min-height: 100vh;
  background: #f5f7fb;
}

.public-bill-main {
  padding: 18px;
}

.bill-sheet {
  box-sizing: border-box;
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  padding: 12px 10px;
  background: #fff;
  color: #000;
  font-family: "TH Sarabun New", "Sarabun New", "Sarabun", Tahoma, Arial, sans-serif;
  font-size: 16px;
}

.bill-sheet *,
.tax-sheet * {
  font-family: "TH Sarabun New", "Sarabun New", "Sarabun", Tahoma, Arial, sans-serif !important;
}

.bill-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-bottom: 0;
  border: 1px solid #000;
  border-bottom: 0;
  background: #ffff00;
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
}

.bill-title::before {
  position: absolute;
  inset: 11px 12px 8px;
  z-index: 0;
  border-radius: 8px;
  content: "";
}

.bill-sale .bill-title {
  color: #783f04;
}

.bill-sale .bill-title::before {
  background: #f8cbad;
}

.bill-purchase .bill-title {
  color: #00705b;
}

.bill-purchase .bill-title::before {
  background: #d9ead3;
}

.bill-title > strong {
  position: relative;
  z-index: 1;
}

.bill-row.section {
  height: 29px;
  border: 1px solid #000;
  border-bottom: 0;
  padding: 4px 6px;
  background: #fff;
  font-weight: 700;
}

.bill-grid {
  display: grid;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

.info-grid {
  grid-template-columns: 120px 1fr 120px 1fr;
}

.partner-grid {
  grid-template-columns: 120px 1fr;
  border-bottom: 1px solid #000;
}

.bill-grid > div {
  min-height: 29px;
  border-top: 1px solid #999;
  padding: 4px 6px;
}

.info-grid > div {
  border-right: 1px solid #999;
}

.info-grid > div:nth-child(4n) {
  border-right: 0;
}

.bill-grid .label {
  background: #fff;
}

.bill-grid .value {
  background: #fff;
}

.bill-grid .highlight,
.bill-items .yellow,
.bill-footer .yellow {
  background: #ffff00;
}

.bill-grid .strong,
.bill-footer .strong {
  font-weight: 700;
}

.bill-items {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 22px;
  background: #fff;
  color: #000;
}

.bill-items th,
.bill-items td {
  border: 1px solid #000;
  padding: 4px 6px;
  white-space: normal;
}

.bill-items th {
  height: 52px;
  background: #fff;
  color: #000;
  text-align: center;
  font-size: 16px;
  line-height: 1.25;
}

.bill-items th span {
  font-size: 16px;
}

.bill-items th:nth-child(1) {
  width: 55px;
}

.bill-items th:nth-child(2) {
  width: 365px;
}

.bill-items th:nth-child(3),
.bill-items th:nth-child(4),
.bill-items th:nth-child(5),
.bill-items th:nth-child(6) {
  width: 82px;
}

.bill-items td {
  height: 29px;
  vertical-align: top;
}

.bill-items .blank-row td {
  height: 29px;
}

.bill-items tbody tr:first-child td {
  height: 32px;
}

.center {
  text-align: center;
}

.bill-footer {
  display: grid;
  grid-template-columns: 455px 1fr;
  grid-template-rows: 42px 29px 29px 29px;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.note-ref,
.note-box,
.baht-text {
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 4px 6px;
}

.note-ref {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  background: #fff2cc;
  line-height: 1.15;
}

.note-box {
  grid-column: 1;
  grid-row: 2 / span 2;
  min-height: 0;
  background: #fff2cc;
}

.baht-text {
  grid-column: 1;
  grid-row: 4;
  min-height: 0;
  border-bottom: 0;
  text-align: center;
  font-weight: 700;
}

.totals {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  grid-template-rows: 42px 29px 29px 29px;
}

.totals > div {
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid #000;
  padding: 4px 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
}

.totals > div:nth-child(odd) {
  text-align: right;
}

.totals > div:nth-child(even) {
  border-left: 1px solid #000;
}

.totals > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.underline {
  text-decoration: underline;
}

.tax-stage {
  overflow: auto;
  padding: 12px 0 32px;
}

.tax-sheet {
  box-sizing: border-box;
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  color: #000;
  font-family: "TH Sarabun New", "Sarabun New", "Sarabun", Tahoma, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.18;
}

.tax-form-border {
  box-sizing: border-box;
  border: 2px solid #000;
  padding: 7px;
}

.tax-form-head {
  display: grid;
  grid-template-columns: 1fr 150px;
  min-height: 42px;
}

.tax-title {
  text-align: center;
}

.tax-title h2 {
  margin: 0 0 2px;
  font-size: 19px;
  line-height: 1.1;
}

.tax-title span {
  display: block;
  font-weight: 700;
}

.tax-book-no {
  padding-top: 2px;
}

.tax-book-no span {
  display: inline-block;
  min-width: 72px;
  border-bottom: 1px dotted #000;
  text-align: center;
}

.tax-party-box {
  display: grid;
  grid-template-columns: 1fr 330px;
  border: 2px solid #000;
  border-bottom: 0;
}

.tax-party-info,
.tax-party-id {
  box-sizing: border-box;
  min-width: 0;
  min-height: 58px;
  padding: 3px 6px;
}

.tax-party-info div {
  margin-top: 3px;
  border-bottom: 1px dotted #000;
  min-height: 15px;
}

.tax-party-id {
  border-left: 2px solid #000;
}

.tax-id-boxes {
  margin-top: 7px;
  white-space: nowrap;
}

.tax-id-cell {
  display: inline-flex;
  width: 15px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.tax-id-dash {
  display: inline-block;
  padding: 0 2px;
  font-weight: 700;
}

.tax-small-box {
  display: inline-flex;
  width: 54px;
  height: 18px;
  margin-left: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  font-weight: 700;
}

.tax-options {
  display: grid;
  grid-template-columns: 140px 72px 1fr 1.1fr 1fr 1fr;
  grid-auto-rows: 19px;
  gap: 0 10px;
  align-items: center;
  align-content: start;
  border: 2px solid #000;
  padding: 2px 6px;
  line-height: 1;
}

.tax-options label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 16px;
  white-space: nowrap;
  font-weight: 700;
}

.tax-options input,
.tax-footer input {
  width: 12px;
  height: 12px;
  margin: 0 3px 0 0;
  vertical-align: middle;
}

.tax-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.tax-table th,
.tax-table td {
  border: 2px solid #000;
  padding: 2px 4px;
  white-space: normal;
  vertical-align: top;
}

.tax-table th {
  background: #fff;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.2;
  padding-top: 4px;
  padding-bottom: 4px;
}

.tax-table th:nth-child(1) {
  width: 49%;
}

.tax-table th:nth-child(2),
.tax-table th:nth-child(3),
.tax-table th:nth-child(4) {
  width: 17%;
}

.tax-income-list {
  font-size: 12.3px;
  line-height: 1.48;
}

.tax-income-list p {
  margin: 0 0 2px;
}

.tax-income-list .indent {
  padding-left: 14px;
}

.tax-income-list .indent2 {
  padding-left: 31px;
}

.tax-income-list .indent3 {
  padding-left: 50px;
}

.tax-dotted {
  height: 14px;
  border-top: 0 !important;
  border-bottom: 1px dotted #777 !important;
}

.tax-data-row td {
  height: 19px;
  vertical-align: middle;
  font-weight: 700;
}

.tax-total td {
  font-weight: 700;
  vertical-align: middle;
}

.tax-baht {
  border: 2px solid #000;
  border-top: 0;
  background: #eeeeee;
  padding: 4px 8px;
  font-weight: 700;
}

.tax-fund-line {
  border: 2px solid #000;
  border-top: 0;
  padding: 4px 8px;
}

.tax-fund-line span {
  display: inline-block;
  min-width: 72px;
  border-bottom: 1px dotted #000;
}

.tax-footer {
  display: grid;
  grid-template-columns: 230px 1fr;
  height: 128px;
  border: 2px solid #000;
  border-top: 0;
  overflow: hidden;
  line-height: 1.02;
}

.tax-footer > div {
  height: 128px;
  min-height: 0;
  padding: 5px 8px;
  overflow: hidden;
}

.tax-footer > div:first-child {
  display: grid;
  grid-template-rows: 18px repeat(4, 21px);
  align-content: start;
}

.tax-footer > div + div {
  border-left: 2px solid #000;
}

.tax-footer label {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  margin-top: 0;
  line-height: 1;
}

.tax-sign-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.tax-certify {
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
}

.tax-sign-body {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  height: 96px;
  min-height: 0;
}

.tax-sign-center {
  text-align: center;
  line-height: 1.08;
}

.tax-stamp-box {
  width: 64px;
  height: 64px;
  justify-self: center;
  align-self: center;
  border: 1px dotted #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
}

.tax-sign-date {
  display: inline-block;
  min-width: 145px;
  border-bottom: 1px dotted #000;
}

.tax-note {
  box-sizing: border-box;
  width: calc(100% - 18px);
  margin: 8px 9px 0;
  padding: 0;
  font-size: 11.4px;
  line-height: 1.28;
}

.tax-note-row {
  display: block;
  width: 100%;
  text-align: left;
  white-space: normal;
}

.tax-note-indent {
  padding-left: 0;
}

.tax-warning {
  box-sizing: border-box;
  width: calc(100% - 18px);
  margin: 8px 9px 0;
  padding: 0;
  font-size: 11.4px;
  font-weight: 700;
  line-height: 1.28;
  text-align: left;
}

@page {
  size: A4 portrait;
  margin: 0;
}

body.export-capture {
  display: block;
  background: #fff;
}

body.export-capture .sidebar,
body.export-capture .no-print {
  display: none;
}

body.export-capture main {
  padding: 0;
}

body.export-capture .bill-stage,
body.export-capture .tax-stage {
  padding: 0;
  overflow: visible;
}

body.export-capture .bill-sheet,
body.export-capture .tax-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0;
}

body.export-capture .tax-sheet {
  padding: 0;
  transform: translateX(4mm) scale(0.96);
  transform-origin: top left;
}

body.export-capture .tax-stage {
  padding-top: 5mm;
}

@media print {
  body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .no-print {
    display: none;
  }

  main {
    padding: 0;
  }

  .bill-stage,
  .tax-stage {
    padding: 0;
    overflow: visible;
  }

  .bill-sheet,
  .tax-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
  }
}

@media (max-width: 920px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    padding: 18px;
  }

  .metrics,
  .split,
  .lookup-grid,
  .form-grid,
  .detail-grid,
  .filters,
  .import-bar {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .header-actions,
  .tab-list {
    flex-wrap: wrap;
  }
}
