:root {
  --statement-navy: #1e3a8a;
  --statement-border: #cbd5e1;
  --statement-muted: #64748b;
  --statement-positive: #059669;
  --statement-negative: #b91c1c;
}

.statement-document {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px;
  box-sizing: border-box;
  background: #fff;
  color: #172033;
  font-family: Inter, "Noto Sans JP", "Noto Sans SC", "Yu Gothic", "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

.statement-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 3px double #172033;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.statement-document-header h1 {
  margin: 0 0 6px;
  font-size: 27px;
  letter-spacing: .08em;
}

.statement-document-header p {
  margin: 0;
  color: var(--statement-muted);
  font-size: 15px;
  font-weight: 700;
}

.statement-document-header img {
  height: 66px;
  object-fit: contain;
}

.statement-addressee {
  display: inline-block;
  margin: 0 0 22px;
  padding-bottom: 4px;
  border-bottom: 1px solid #172033;
  font-size: 17px;
  font-weight: 700;
}

.statement-property {
  margin: 0 0 24px;
  break-inside: avoid;
}

.statement-property-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--statement-navy);
  padding-bottom: 6px;
  margin-bottom: 9px;
  color: var(--statement-navy);
  font-size: 14px;
}

.property-mode {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
}

.property-metrics {
  color: #475569;
  font-size: 10px;
  white-space: nowrap;
}

.property-metrics span {
  padding: 0 4px;
  color: #94a3b8;
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  font-size: 10px;
}

.statement-table th,
.statement-table td {
  border: 1px solid var(--statement-border);
  padding: 5px 4px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.statement-table th {
  background: #eff4fa;
  color: #1f2937;
  font-weight: 700;
}

.statement-table tfoot td {
  background: #f8fafc;
  font-weight: 700;
}

.statement-table .text-left {
  text-align: left;
}

.statement-portal-view .statement-document {
  min-width: 1040px;
}

.statement-portal-view .statement-bookings th:nth-child(1) { width: 4%; }
.statement-portal-view .statement-bookings th:nth-child(2),
.statement-portal-view .statement-bookings th:nth-child(3) { width: 6%; }
.statement-portal-view .statement-bookings th:nth-child(4) { width: 4%; }
.statement-portal-view .statement-bookings th:nth-child(5) { width: 16%; }

.statement-portal-view .statement-bookings .statement-guest-name {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-table .money {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.statement-table .strong {
  font-weight: 700;
}

.statement-table .muted {
  color: var(--statement-muted);
}

.statement-expense-row.is-interactive {
  cursor: pointer;
}

.statement-expense-row.is-interactive:hover,
.statement-expense-row.is-interactive:focus {
  background: #eff6ff;
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

.statement-expenses th:nth-child(1) { width: 5%; }
.statement-expenses th:nth-child(2) { width: 10%; }
.statement-expenses th:nth-child(3) { width: 18%; }
.statement-expenses th:nth-child(4) { width: 25%; }
.statement-expenses th:nth-child(5) { width: 11%; }
.statement-expenses th:nth-child(6) { width: 10%; }
.statement-expenses th:nth-child(7) { width: 6%; }
.statement-expenses th:nth-child(8) { width: 15%; }

.statement-receipt-icon {
  font-size: 13px;
}

.statement-receipt-button {
  border: 0;
  padding: 2px 5px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  border-radius: 5px;
}

.statement-receipt-button:hover,
.statement-receipt-button:focus-visible {
  background: #dbeafe;
  outline: 2px solid #93c5fd;
}

.statement-fixed-detail {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.statement-fixed-detail:hover,
.statement-fixed-detail:focus-visible {
  color: var(--statement-navy);
  outline: none;
}

.statement-table .is-excluded {
  color: #94a3b8;
  text-decoration: line-through;
  background: #f8fafc;
}

.excluded-label {
  margin-left: 5px;
  padding: 1px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: 8px;
  text-decoration: none;
}

.statement-grand-total {
  margin: 8px 0 28px;
  border-top: 2px solid #172033;
}

.statement-grand-total th,
.statement-grand-total td {
  background: var(--statement-navy);
  color: #fff;
  font-weight: 700;
}

.statement-divider {
  margin: 30px 0 20px;
  padding-top: 12px;
  border-top: 3px double var(--statement-navy);
  color: var(--statement-navy);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  font-weight: 800;
}

.statement-section {
  margin-bottom: 25px;
  break-inside: avoid;
}

.statement-section h2,
.statement-bottom h2 {
  margin: 0 0 8px;
  padding-left: 8px;
  border-left: 4px solid var(--statement-navy);
  color: var(--statement-navy);
  font-size: 13px;
}

.empty-row {
  padding: 15px !important;
  color: #94a3b8;
  text-align: center !important;
}

.statement-bottom {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 28px;
  align-items: start;
  break-inside: avoid;
}

.statement-card {
  padding: 15px;
  border: 2px solid var(--statement-navy);
  border-radius: 8px;
  background: #f8fafc;
}

.statement-card > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--statement-border);
}

.statement-card > div:last-child {
  border-bottom: 0;
}

.bank-card span {
  color: var(--statement-muted);
}

.summary-card .positive {
  color: var(--statement-positive);
}

.summary-card .final {
  align-items: center;
  margin-top: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--statement-border);
  border-bottom: 0;
  font-size: 13px;
  font-weight: 800;
}

.summary-card .final strong {
  color: var(--statement-positive);
  font-size: 21px;
  white-space: nowrap;
}

@page {
  size: A4 landscape;
  margin: 9mm;
}

@media print {
  .statement-document {
    max-width: none;
    padding: 0;
  }
}
