:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Meiryo", sans-serif;
  color: #334155;
  background: #f5f7f9;
  font-size: 14px;
  --line: #e2e8ee;
  --accent: #526e84;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a {
  cursor: pointer;
}
button,
.button {
  background: #fff;
  border: 1px solid #d5dfe7;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  display: inline-block;
  color: #43596c;
}
button:hover,
.button:hover {
  background: #edf4f8;
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
input,
select {
  background: #fff;
  border: 1px solid #d5dfe7;
  border-radius: 5px;
  padding: 7px;
  min-height: 36px;
  max-width: 100%;
}
input[type="checkbox"] {
  min-height: 18px;
  width: 18px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid #7199b5;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
header {
  height: 65px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.brand {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.07em;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #92a3b1;
}
nav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
nav button {
  border: 0;
  background: transparent;
  font-size: 13px;
  padding: 8px 11px;
}
nav button.active {
  background: #eaf2f7;
  color: #47677e;
}
main {
  max-width: 1540px;
  margin: auto;
  padding: 30px;
}
h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}
p {
  line-height: 1.8;
}
small,
.muted {
  font-size: 12px;
  color: #81909f;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.filters input[type="search"] {
  width: 230px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 22px 0;
}
.card,
.panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 22px;
}
.card span {
  font-size: 13px;
  color: #81909f;
}
.card strong {
  display: block;
  font-size: 30px;
  font-weight: 550;
  letter-spacing: 0.02em;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.card:last-child {
  background: #edf3f7;
}
.panel {
  margin: 18px 0;
}
.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ledger {
  border-collapse: collapse;
  min-width: 1250px;
  width: 100%;
  table-layout: fixed;
  font-size: 15px;
}
.ledger th {
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  color: #81909f;
  background: #fafcfd;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger td {
  padding: 5px 4px;
  height: 49px;
  border-bottom: 1px solid #edf1f4;
  white-space: nowrap;
}
.ledger input:not([type="checkbox"]),
.ledger select {
  font-size: 15px;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  padding: 6px 3px;
  min-height: 35px;
}
.ledger input:hover,
.ledger select:hover {
  border-color: #e2e8ee;
}
.ledger input:focus,
.ledger select:focus {
  background: #fff;
  border-color: #8ba8bc;
}
.ledger input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger input[type="date"] {
  font-size: 13px;
}
.ledger tr:hover {
  background: #fafcfd;
}
.ledger .pending {
  background: #fffaf0;
}
.ledger .delete {
  border: 0;
  padding: 5px;
  background: transparent;
  color: #9b7b7b;
}
.ledger th:nth-child(1) {
  width: 32px;
}
.ledger th:nth-child(2) {
  width: 132px;
}
.ledger th:nth-child(3) {
  width: 220px;
}
.ledger th:nth-child(4) {
  width: 83px;
}
.ledger th:nth-child(5) {
  width: 84px;
}
.ledger th:nth-child(6) {
  width: 90px;
}
.ledger th:nth-child(7) {
  width: 130px;
}
.ledger th:nth-child(8) {
  width: 119px;
}
.ledger th:nth-child(9) {
  width: 113px;
}
.ledger th:last-child {
  width: 90px;
}
.summary {
  padding: 14px 18px;
  background: #f0f5f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 15px 0;
  font-size: 13px;
}
.empty {
  padding: 35px;
  text-align: center;
  color: #8c9aa7;
}
.fields {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: end;
}
.fields label {
  font-size: 12px;
  color: #7f90a0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fields input,
.fields select {
  color: #334155;
}
.fields label.wide {
  min-width: 220px;
}
details {
  margin: 15px 0;
}
summary {
  cursor: pointer;
  padding: 10px 0;
  color: #647f93;
}
.notice {
  background: #fff8e8;
  border: 1px solid #eee0be;
  color: #876e46;
  padding: 13px 16px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 13px;
}
.chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 15px;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
}
.track {
  background: #eff3f6;
  height: 9px;
  border-radius: 3px;
  overflow: hidden;
}
.bar {
  height: 100%;
  background: #a0b9ca;
}
.chart-row strong {
  text-align: right;
  font-weight: 500;
}
progress {
  width: 100%;
  height: 12px;
  accent-color: #9db6c8;
}
.login {
  max-width: 390px;
  margin: 10vh auto;
  padding: 30px;
}
.login label {
  display: block;
  margin: 15px 0;
}
.login input {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.login button {
  width: 100%;
}
.login h1 {
  margin-bottom: 20px;
}
#toast {
  display: none;
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #455e71;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  max-width: 90vw;
  z-index: 100;
  box-shadow: 0 8px 25px #33415530;
  font-size: 13px;
}
#toast.show {
  display: flex;
  align-items: center;
  gap: 15px;
}
#toast button {
  padding: 4px 10px;
}
.error {
  color: #a54d48;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(850px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 25px;
  color: #334155;
}
dialog::backdrop {
  background: #24394d44;
}
.file-row {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.file-row strong {
  font-size: 14px;
  font-weight: 500;
}
.file-row small {
  display: block;
}
.audit-row {
  display: grid;
  grid-template-columns: 170px 1fr 100px;
  gap: 10px;
  border-bottom: 1px solid #edf1f4;
  padding: 9px;
  font-size: 12px;
}
.footer {
  font-size: 11px;
  color: #93a0ab;
  padding-top: 28px;
}
.bulk {
  background: #eaf2f7;
  padding: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.bulk select {
  font-size: 12px;
}
#status {
  font-size: 12px;
  color: #8294a2;
}
.link {
  border: 0;
  background: transparent;
  color: #66849b;
  font-size: 12px;
  padding: 5px;
}
.annual {
  display: flex;
  align-items: end;
  gap: 9px;
  height: 180px;
  overflow-x: auto;
}
.annual > div {
  min-width: 35px;
  flex: 1;
  text-align: center;
  font-size: 11px;
}
.annual-bar {
  background: #a6bdcd;
  width: 65%;
  margin: auto;
  min-height: 2px;
}
.annual small {
  display: block;
  margin-top: 7px;
  font-size: 11px;
}
.check {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.sensitive {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.form-error {
  margin-top: 15px;
  color: #a54d48;
  font-size: 13px;
}
@media (max-width: 850px) {
  header {
    height: auto;
    min-height: 65px;
    flex-wrap: wrap;
    padding: 12px 15px;
    gap: 8px;
  }
  nav {
    order: 3;
    width: 100%;
  }
  nav button {
    font-size: 12px;
    padding: 8px;
  }
  main {
    padding: 20px 13px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .heading {
    gap: 12px;
    align-items: start;
  }
  .heading h1 {
    font-size: 22px;
  }
  .cards {
    gap: 8px;
  }
  .card {
    padding: 14px 10px;
  }
  .card strong {
    font-size: 22px;
  }
  .panel {
    padding: 16px;
  }
  .audit-row {
    grid-template-columns: 130px 1fr;
  }
  .audit-row span:last-child {
    display: none;
  }
  .file-row {
    flex-wrap: wrap;
  }
  .fields label {
    flex: 1;
    min-width: 145px;
  }
  .fields input,
  .fields select {
    width: 100%;
  }
  .chart-row {
    grid-template-columns: 95px 1fr 95px;
    gap: 8px;
  }
  .login {
    margin: 7vh auto;
  }
  .ledger {
    min-width: 1250px;
  }
  .footer {
    padding-bottom: 30px;
  }
}
