:root {
  font-family:
    "Instrument Sans",
    system-ui,
    -apple-system,
    sans-serif;
  color: #203d35;
  background: #f2f5f3;
  font-synthesis: none;
  --green: #154f43;
  --muted: #61776e;
  --line: #dbe5df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button,
.button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 0.65rem 1rem;
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
button.primary,
.button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.danger {
  color: #a53637;
}
button.text {
  border: 0;
  background: none;
  padding: 0.4rem;
}
a {
  color: var(--green);
}
input,
select,
textarea {
  width: 100%;
  padding: 0.72rem;
  border: 1px solid #b9ccc1;
  border-radius: 8px;
  background: white;
  color: #203d35;
}
input[type="checkbox"] {
  width: auto;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
}
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.06rem;
  line-height: 1.2;
  margin: 0.3rem 0;
}
h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
h3 {
  font-size: 1rem;
  margin: 0.7rem 0;
}
p {
  line-height: 1.65;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.85rem;
}
.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1.7rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.06rem;
  margin: 0 0.65rem 2rem;
  display: block;
  text-decoration: none;
}
.brand span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.2rem;
}
.sidebar nav {
  display: grid;
  gap: 0.25rem;
}
.sidebar button {
  text-align: left;
  border: 0;
  font-size: 0.92rem;
  font-weight: 500;
}
.sidebar button.active {
  background: #e5f0e9;
  color: #124d3f;
  font-weight: 700;
}
.sidebar .nav-label {
  font-size: 0.72rem;
  letter-spacing: 0.09rem;
  text-transform: uppercase;
  margin: 1.2rem 0.7rem 0.4rem;
  color: #687f72;
}
.workspace {
  min-width: 0;
}
.topbar {
  padding: 1.2rem 2.25rem;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar .user {
  font-size: 0.9rem;
}
.topbar .user small {
  display: block;
}
.content {
  max-width: 1400px;
  margin: auto;
  padding: 2rem 2.25rem 4rem;
}
.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
}
.pagehead p {
  margin: 0.5rem 0 0;
}
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 1.4rem;
  min-width: 0;
}
.card .value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04rem;
  margin: 0.6rem 0;
}
.card.hero {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.card.hero small {
  color: #c8dfd2;
}
.twocol {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.3rem;
}
.stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}
.toolbar input {
  max-width: 340px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
  font-size: 0.9rem;
}
th {
  background: #f8faf8;
  color: #587065;
  font-size: 0.78rem;
  font-weight: 600;
}
td,
th {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #e8eee9;
}
tr:last-child td {
  border-bottom: 0;
}
td .sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  font-size: 0.77rem;
  padding: 0.25rem 0.6rem;
  background: #e5f1e9;
  color: #236044;
}
.badge.warn {
  background: #fff0d4;
  color: #885b17;
}
.badge.red {
  background: #f9e7e7;
  color: #9b3f3f;
}
.empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}
.login {
  max-width: 430px;
  margin: 9vh auto;
  padding: 2rem;
}
.login .brand {
  margin: 0 0 2.5rem;
}
.login h1 {
  font-size: 1.8rem;
}
.login button {
  width: 100%;
  margin-top: 1rem;
}
.field {
  margin-bottom: 1rem;
}
.field small {
  display: block;
  margin-top: 0.3rem;
  line-height: 1.4;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.field.full {
  grid-column: 1/-1;
}
.notice {
  background: #edf4ef;
  border: 1px solid #c9dfcf;
  padding: 0.85rem 1rem;
  border-radius: 9px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.notice.error {
  background: #fff0ed;
  border-color: #efb7af;
  color: #93362f;
}
.demo-banner {
  background: #fff4cd;
  padding: 0.65rem 1.2rem;
  font-size: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.demo-banner select {
  width: auto;
  padding: 0.25rem;
  font-size: 0.85rem;
}
.demo-banner button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #edf1ee;
  gap: 1rem;
}
.row:last-child {
  border: 0;
}
.row small {
  display: block;
  margin-top: 0.2rem;
}
.graph {
  height: 150px;
  display: flex;
  gap: 1rem;
  align-items: end;
  padding-top: 1rem;
}
.graph .group {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  position: relative;
  padding-bottom: 24px;
}
.graph i {
  width: 18px;
  min-height: 2px;
  display: block;
  background: #398465;
  border-radius: 4px 4px 0 0;
}
.graph i.out {
  background: #d4a363;
}
.graph span {
  position: absolute;
  bottom: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  margin-top: 0.8rem;
}
.legend span:first-child {
  color: #398465;
}
.legend span:last-child {
  color: #9c6b33;
}
dialog {
  border: 0;
  border-radius: 16px;
  max-width: 720px;
  width: calc(100% - 28px);
  max-height: 90vh;
  padding: 0;
  color: #203d35;
  box-shadow: 0 20px 80px #001a1740;
}
dialog::backdrop {
  background: #112c2690;
  backdrop-filter: blur(2px);
}
#dialog-body {
  padding: 1.6rem;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-head button {
  padding: 0.25rem 0.6rem;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 0.9rem 1.2rem;
  background: #203d35;
  color: white;
  border-radius: 10px;
  z-index: 100;
  display: none;
  max-width: 90vw;
}
.detail {
  white-space: pre-wrap;
  line-height: 1.75;
}
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.6rem;
  font-size: 0.92rem;
  margin: 1rem 0;
}
.detail-grid dt {
  color: var(--muted);
}
.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.signature-preview {
  max-width: 200px;
  max-height: 100px;
}
.loading {
  text-align: center;
  padding: 4rem;
}
.total {
  background: #edf4ef;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.mobile-menu {
  display: none;
}
.login .notice {
  margin-top: 1rem;
}
.article {
  padding: 1.4rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.article p {
  white-space: pre-wrap;
}
.muted-caption {
  font-size: 0.8rem;
  margin-top: 1.5rem;
}
button.small {
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}
.amount-out {
  color: #a44740;
}
.settings-layout {
  max-width: 850px;
}
.summary-link {
  cursor: pointer;
}
.demo-banner ~ .shell .sidebar {
  top: 0;
}
@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .content {
    padding: 1.5rem;
  }
  .topbar {
    padding: 1rem 1.5rem;
  }
  .twocol {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .shell.menu-open .sidebar {
    transform: translateX(0);
    box-shadow: 20px 0 100px #001a1760;
  }
  .mobile-menu {
    display: inline-block;
  }
  .topbar {
    padding: 1rem;
  }
  .content {
    padding: 1.4rem 1rem;
  }
  .pagehead {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 1.6rem;
  }
  .cards {
    gap: 0.7rem;
  }
  .card {
    padding: 1.1rem;
  }
  .card .value {
    font-size: 1.45rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar input {
    max-width: none;
  }
  .topbar .user {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .detail-grid {
    grid-template-columns: 110px 1fr;
  }
  .login {
    margin: 4vh auto;
    padding: 1.5rem;
  }
  .graph {
    gap: 0.5rem;
  }
  .table-wrap td,
  .table-wrap th {
    padding: 0.8rem;
  }
  .demo-banner {
    font-size: 0.75rem;
  }
}
.choices {
  border: 0;
  padding: 0;
  min-width: 0;
}
.choices legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.choices > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.choices label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
  margin: 0;
}
.choices input {
  width: auto;
  accent-color: var(--green);
}
.choices label:has(input:checked) {
  background: #e5f0e9;
  border-color: #4f9476;
}
