@font-face {
  font-family: DM Sans;
  src: url("/fonts/dm-sans-400.ttf");
}
@font-face {
  font-family: DM Sans;
  src: url("/fonts/dm-sans-600.ttf");
  font-weight: 600;
}
:root {
  --ink: #14282b;
  --muted: #62716c;
  --green: #bbed9e;
  --paper: #f6f6ee;
  --line: #d9dfd5;
  --red: #ac3628;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px "DM Sans",
    sans-serif;
}
header {
  height: 86px;
  background: #102328;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  gap: 20px;
}
.brand {
  font-size: 28px;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.brand > span:not(.pulse) {
  color: var(--green);
}
.brand small {
  font-size: 10px;
  letter-spacing: 2px;
  border-left: 1px solid #536265;
  padding: 10px 0 10px 18px;
  margin-left: 13px;
}
.pulse {
  font-size: 38px;
  color: var(--green);
}
#account {
  display: flex;
  gap: 10px;
  align-items: center;
}
main {
  margin: 36px auto 64px;
  padding: 0 4vw;
  max-width: 1800px;
}
h1 {
  font-size: 34px;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
h2 {
  font-size: 23px;
  margin: 0 0 15px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
header small {
  color: #afc2bb;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
button:hover,
.button:hover {
  background: #edf4e6;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  font-weight: 600;
}
button.danger {
  color: var(--red);
}
header button {
  padding: 7px 10px;
  font-size: 12px;
  background: transparent;
  color: #e8eee9;
  border-color: #536265;
}
header button:hover {
  background: #233b3e;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  color: var(--ink);
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #6a994c;
  outline-offset: 2px;
}
textarea {
  resize: vertical;
  min-height: 72px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.tabs {
  display: flex;
  gap: 25px;
  margin: 28px 0 25px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 2px;
  font-size: 15px;
  white-space: nowrap;
}
.tabs button.active {
  border-color: #608445;
  font-weight: 600;
}
.topline,
.toolbar,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar {
  margin: 20px 0;
}
.toolbar > div,
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 8px;
}
.card .eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}
.figures {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
}
.figures > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.figures strong {
  font-size: 24px;
  letter-spacing: -0.7px;
  color: var(--ink);
}
.figures strong.negative {
  color: var(--red);
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: #e9eee3;
  padding: 13px 10px;
  white-space: nowrap;
  color: #486052;
}
td {
  padding: 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
table.ledger {
  min-width: 1500px;
}
table.ledger input,
table.ledger select,
table.ledger textarea {
  width: 100%;
  padding: 7px;
  border-color: transparent;
  border-radius: 2px;
}
table.ledger input:hover,
table.ledger select:hover,
table.ledger textarea:hover {
  border-color: var(--line);
}
table.ledger textarea {
  font-size: 12px;
  min-height: 49px;
  max-height: 120px;
}
td.id {
  min-width: 165px;
  font-size: 11px;
  white-space: nowrap;
}
td.id strong {
  display: block;
  padding-top: 9px;
  font-weight: 600;
}
td.description {
  min-width: 150px;
}
td.comments {
  min-width: 200px;
}
td.amount {
  min-width: 110px;
}
td.rate {
  min-width: 85px;
}
td.receipts {
  min-width: 145px;
  font-size: 11px;
}
td.controls {
  min-width: 310px;
}
.record-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.record-actions button { white-space: nowrap; }
td.controls button {
  padding: 7px 9px;
  font-size: 11px;
  margin-bottom: 7px;
}
td.receipts a {
  display: block;
  color: #3f672b;
  margin-bottom: 7px;
}
td.receipts button {
  font-size: 10px;
  padding: 4px 6px;
}
.entry-void {
  opacity: 0.65;
  background: #faf8f4;
}
.saved {
  color: #548337;
  font-size: 11px;
}
.dirty {
  color: #986417;
  font-size: 11px;
}
.empty {
  text-align: center;
  padding: 45px;
  color: var(--muted);
}
.note {
  padding: 12px 15px;
  background: #e9efdf;
  border-radius: 5px;
  font-size: 12px;
  color: #47603b;
  margin: 15px 0;
}
.error {
  color: var(--red);
  line-height: 1.5;
  min-height: 1em;
}
.auth {
  max-width: 440px;
  margin: 70px auto;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth h1 {
  font-size: 28px;
}
.auth form {
  display: grid;
  gap: 18px;
  margin-top: 25px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #5b7750;
  text-transform: uppercase;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-grid .actions {
  margin-top: 10px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  width: min(680px, 94vw);
  max-height: 90vh;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop {
  background: #10232899;
}
dialog .dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
}
dialog .dialog-top button {
  padding: 5px 10px;
}
.count {
  font-size: 10px;
  text-align: right;
  color: var(--muted);
  font-weight: 400;
}
.field-change {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  margin: 10px 0;
  border-radius: 5px;
}
.field-change label {
  font-weight: 400;
  flex-direction: row;
  align-items: start;
  margin: 10px 0;
  word-break: break-word;
}
.field-change input {
  margin-top: 3px;
}
.log-detail {
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-table td {
  font-size: 12px;
}
.log-table td:nth-child(1) {
  white-space: nowrap;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-grid .card {
  display: grid;
  gap: 15px;
  align-content: start;
}
.settings-grid .card .actions {
  justify-content: start;
}
.loading {
  text-align: center;
  padding: 60px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #153b2c;
  color: white;
  padding: 12px 20px;
  box-shadow: 0 5px 25px #0002;
  border-radius: 6px;
  z-index: 20;
  display: none;
  max-width: 90vw;
}
#toast.error {
  background: #8a2d22;
}
footer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}
.reports table {
  min-width: 600px;
}
.reports .amount {
  text-align: right;
}
.reports th.amount {
  text-align: right;
}
.inline-status {
  font-size: 11px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 800px) {
  header {
    padding: 0 20px;
    height: auto;
    min-height: 85px;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .brand {
    font-size: 24px;
  }
  .brand small {
    font-size: 9px;
    padding-left: 10px;
    margin-left: 5px;
  }
  #account {
    font-size: 11px;
  }
  main {
    padding: 0 20px;
    margin-top: 25px;
  }
  h1 {
    font-size: 28px;
  }
  .summary,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .figures strong {
    font-size: 21px;
  }
  .toolbar {
    align-items: start;
  }
  .toolbar > div {
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .auth {
    margin-top: 40px;
  }
  dialog {
    padding: 20px;
  }
  .tabs {
    gap: 22px;
  }
  .mobile-add {
    display: inline-flex;
  }
}
@media (min-width: 801px) {
  .mobile-add {
    display: none;
  }
}
/* Keep currency summaries inside a narrow mobile viewport. */
.card {
  min-width: 0;
}
@media (max-width: 800px) {
  .figures {
    flex-wrap: wrap;
  }
}
body {
  font-family:
    "DM Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.ledger select {
  min-width: 90px;
}
.ledger td.controls,
.ledger th:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -3px 0 8px #14282b0a;
}
.ledger td.id,
.ledger th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  min-width: 180px;
}
.ledger th:first-child,
.ledger th:last-child {
  background: #e9eee3;
  z-index: 3;
}
