.tbmc-finance {
  color: inherit;
  max-width: 1500px;
  margin: 0 auto;
}

.tbmc-finance-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.tbmc-finance-tabs a,
.tbmc-finance button,
.tbmc-finance-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #9a623a;
  background: #b97954;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.1;
}

.tbmc-finance button.tbmc-finance-danger-button {
  border-color: #b85b4b;
  background: #7c2d22;
}

.tbmc-finance button.tbmc-finance-danger-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.tbmc-finance-tabs a.active {
  background: #fff;
  color: #21120c;
}

.tbmc-finance-button:hover,
.tbmc-finance-button:focus {
  color: #fff;
  text-decoration: none;
}

.tbmc-finance-card {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #9a623a;
  background: #2b1a10;
  color: #f5f5f5;
}

.tbmc-finance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tbmc-finance-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.tbmc-finance-stats > div {
  padding: 16px;
  border: 1px solid #9a623a;
  background: #2b1a10;
  color: #f5f5f5;
}

.tbmc-finance-stats span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  opacity: .75;
}

.tbmc-finance-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.tbmc-finance table {
  width: 100%;
  border-collapse: collapse;
}

.tbmc-finance th,
.tbmc-finance td {
  padding: 9px;
  border: 1px solid #9a623a;
  vertical-align: top;
}

.tbmc-finance th {
  background: #2b1a10;
  color: #fff;
  text-align: left;
}

.tbmc-finance td {
  background: #150b07;
  color: #f5f5f5;
}

.tbmc-finance input,
.tbmc-finance select,
.tbmc-finance textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #b97954;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}

.tbmc-finance label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 700;
}

.tbmc-finance-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.tbmc-finance-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}

.tbmc-finance-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.tbmc-finance-filterbar a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #9a623a;
  background: #3a2418;
  color: #f5f5f5;
  text-decoration: none;
  font-weight: 700;
}

.tbmc-finance-filterbar a.active {
  background: #fff;
  color: #21120c;
}

.tbmc-finance-filterbar span {
  color: #c9b39a;
  font-size: 13px;
}

.tbmc-finance table + .tbmc-finance-actions {
  margin: 12px 0 0;
}

.tbmc-finance-inline label {
  margin: 0;
}

.tbmc-finance-inline select,
.tbmc-finance-inline input {
  width: auto;
}

.tbmc-finance-event-controls {
  padding: 16px 18px;
}

.tbmc-finance-event-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.tbmc-finance-event-toolbar h2 {
  margin-bottom: 4px;
}

.tbmc-finance-event-toolbar p {
  margin: 0;
  color: #f5f5f5;
}

.tbmc-finance-event-selector {
  margin-top: 0;
}

.tbmc-finance-event-add {
  margin-top: 12px;
}

.tbmc-finance-event-add summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #9a623a;
  background: #3a2418;
  color: #f5f5f5;
}

.tbmc-finance-event-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 12px;
}

.tbmc-finance-event-add-form .tbmc-finance-full {
  grid-column: 1 / -1;
}

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

.tbmc-finance .month-divider td,
.tbmc-finance .ledger-detail {
  background: #3a2418;
  color: #f5f5f5;
  font-weight: 700;
}

.tbmc-finance .tbmc-finance-uncategorized-row td {
  background: #3a2507;
  box-shadow: inset 4px 0 0 #d79a43;
}

.tbmc-finance .tbmc-finance-uncategorized-row strong {
  color: #ffd98c;
}

.tbmc-finance .tbmc-finance-uncategorized-row select[name*="[category_id]"] {
  border-color: #d79a43;
  box-shadow: 0 0 0 2px rgba(215, 154, 67, .25);
}

.tbmc-finance .badge {
  display: inline-block;
  padding: 4px 8px;
  background: #f3e8e2;
  color: #3b2a1a;
  font-weight: 700;
}

.tbmc-finance-notice {
  padding: 12px;
  margin: 10px 0;
  border-left: 4px solid #8b4513;
  background: #f3e8e2;
  color: #3b2a1a;
}

.tbmc-finance-subsection {
  margin-top: 14px;
}

.tbmc-finance-subsection:first-child {
  margin-top: 0;
}

.tbmc-finance-subsection h4 {
  margin: 0 0 8px;
  color: #f5f5f5;
  font-size: 18px;
}

.tbmc-finance-subsection h4 span {
  color: #c9b39a;
  font-size: 14px;
  font-weight: 400;
}

.tbmc-finance details {
  margin-top: 10px;
}

.tbmc-finance summary {
  cursor: pointer;
  color: #f5f5f5;
  font-weight: 700;
}

.tbmc-finance details table {
  margin-top: 8px;
}

.tbmc-finance-version {
  margin-top: 18px;
  color: #c9b39a;
  font-size: 12px;
  text-align: right;
}

@media (max-width: 900px) {
  .tbmc-finance-grid,
  .tbmc-finance-stats {
    grid-template-columns: 1fr;
  }

  .tbmc-finance-event-toolbar {
    align-items: stretch;
  }

  .tbmc-finance-event-selector,
  .tbmc-finance-event-selector select {
    width: 100%;
  }

  .tbmc-finance-event-add-form {
    grid-template-columns: 1fr;
  }

  .tbmc-finance table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .tbmc-finance-tabs,
  .tbmc-finance button,
  .tbmc-finance-button,
  .tbmc-finance input,
  .tbmc-finance select,
  .tbmc-finance-inline {
    display: none !important;
  }

  .tbmc-finance-card {
    border-color: #999;
    break-inside: avoid;
  }
}
