:root {
  --bg: #f4f6f3;
  --paper: #fff;
  --ink: #1c302b;
  --muted: #6e7d76;
  --line: #dfe6df;
  --green: #163f37;
  --lime: #d5ef92;
  --red: #a63c35;
  --radius: 15px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 15px;
  color: var(--ink);
  font-weight: 550;
}
button:hover {
  background: #edf3e7;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.primary:hover {
  background: #24584b;
}
button.danger {
  color: var(--red);
}
button.small {
  padding: 6px 10px;
  font-size: 12px;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced9cf;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b9d58c;
  outline-offset: 1px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.9px;
  font-weight: 650;
  margin-bottom: 7px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
}
small,
.muted {
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--green);
  color: #e7eee6;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.6px;
  padding: 0 12px;
  margin-bottom: 36px;
}
.brand small {
  display: block;
  color: #b9d5b3;
  letter-spacing: 3px;
  font-size: 10px;
  text-transform: uppercase;
  margin-top: 7px;
}
.nav {
  display: grid;
  gap: 6px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c3d3c9;
  padding: 12px 14px;
  font-weight: 450;
}
.nav button.active {
  background: #2b5549;
  color: #eff7d3;
}
.nav button:hover {
  background: #244d42;
}
.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}
.side-foot {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid #36594e;
  font-size: 11px;
  color: #a8c1b3;
  line-height: 1.7;
}
.side-foot strong {
  color: #eaf2df;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbf8;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e7eddc;
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 600;
}
.page {
  padding: 32px 38px;
  max-width: 1600px;
  margin: auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 25px;
}
.heading p {
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #70866c;
  margin-bottom: 10px;
}
.toolbar {
  display: flex;
  gap: 9px;
  align-items: end;
  flex-wrap: wrap;
}
.toolbar input,
.toolbar select {
  width: auto;
  max-width: 190px;
}
.toolbar label {
  min-width: 130px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 24px;
}
.personal-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.personal-presets {
  margin-top: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 23px;
}
.metric-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.metric {
  font-size: 28px;
  font-weight: 620;
  letter-spacing: -1px;
  white-space: nowrap;
}
.metric span {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 450;
  margin-left: 5px;
}
.metric-note {
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
}
.featured {
  background: var(--green);
  color: #f4f9eb;
}
.featured .metric-title,
.featured .metric-note {
  color: #b9d0bc;
}
.featured .metric {
  color: var(--lime);
}
.grid2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px;
  margin-bottom: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 0;
}
.tag {
  font-size: 10px;
  font-weight: 550;
  padding: 5px 8px;
  background: #edf3e5;
  color: #557049;
  border-radius: 5px;
  white-space: nowrap;
}
.tag.review {
  background: #fff1d4;
  color: #8c6d2e;
}
.tag.reversed {
  background: #f4e8e4;
  color: var(--red);
}
.tag.draft {
  background: #edf0ef;
  color: #6b7772;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  font-size: 10px;
  letter-spacing: 0.7px;
  font-weight: 550;
  color: #809087;
  text-transform: uppercase;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 10px;
  border-bottom: 1px solid #eef1ed;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td a,
td button.link {
  font-weight: 550;
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #eef1ed;
  gap: 14px;
}
.balance-row:last-child {
  border: 0;
}
.coin {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eff3e7;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #46614c;
  flex-shrink: 0;
}
.balance-name {
  flex: 1;
  font-size: 13px;
}
.balance-name small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
}
.balance-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 550;
}
.balance-value small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  font-weight: 400;
}
.banner {
  border-radius: 10px;
  padding: 14px 17px;
  background: #edf2e4;
  border: 1px solid #dbe7cb;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.banner.warn {
  background: #fff6e1;
  border-color: #eddfb3;
  color: #785d25;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 13px;
}
.cash-spark {
  display: flex;
  align-items: end;
  height: 80px;
  gap: 8px;
  margin: 24px 0 8px;
}
.cash-spark i {
  display: block;
  background: #d6e6bf;
  border-radius: 4px 4px 0 0;
  flex: 1;
}
.cash-spark i:last-child {
  background: var(--green);
}
.legend {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #87a46e;
  margin-right: 5px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.form-error {
  font-size: 12px;
  color: var(--red);
  margin: 12px 0;
  white-space: pre-wrap;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.row-editor {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.row-editor button {
  padding: 10px;
}
.row-editor select {
  max-width: 180px;
}
.line-extra {
  grid-column: 1/-1;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.detail-item {
  padding: 14px;
  background: #f5f7f1;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.detail-item small {
  display: block;
  margin-bottom: 7px;
}
.detail-item strong {
  font-size: 14px;
  font-weight: 600;
}
.json {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f7f3;
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  max-height: 400px;
  overflow: auto;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-brand {
  background: var(--green);
  color: white;
  padding: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand h1 {
  font-size: 52px;
  line-height: 1.05;
  max-width: 530px;
  color: #eaf2df;
}
.login-brand p {
  max-width: 380px;
  color: #b6cdbd;
  font-size: 16px;
  line-height: 1.7;
}
.login-card {
  display: grid;
  place-items: center;
  padding: 35px;
}
.login-card form {
  width: 100%;
  max-width: 370px;
}
.login-card label {
  margin-bottom: 15px;
}
.login-card button {
  width: 100%;
  margin-bottom: 10px;
}
.login-card .brand {
  padding: 0;
  margin-bottom: 40px;
}
.login-card h2 {
  font-size: 25px;
}
.login-art {
  display: flex;
  align-items: end;
  gap: 18px;
  height: 150px;
}
.login-art i {
  width: 55px;
  background: #d5ef92;
  border-radius: 10px 10px 0 0;
}
.login-art i:nth-child(1) {
  height: 55px;
  opacity: 0.25;
}
.login-art i:nth-child(2) {
  height: 100px;
  opacity: 0.45;
}
.login-art i:nth-child(3) {
  height: 80px;
  opacity: 0.65;
}
.login-art i:nth-child(4) {
  height: 145px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 850px;
  width: calc(100% - 32px);
  max-height: 92vh;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #102b254f;
  backdrop-filter: blur(2px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
}
.modal-head h2 {
  margin: 0;
}
#toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  background: var(--green);
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  max-width: 420px;
  display: none;
  z-index: 99;
  font-size: 13px;
  box-shadow: 0 8px 25px #1234;
}
.offline {
  background: #fff1d4;
  padding: 9px;
  text-align: center;
  color: #805c27;
  font-size: 12px;
}
.note-box {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.check input {
  width: auto;
  min-height: 0;
}
.summary-strip {
  display: flex;
  gap: 25px;
  padding: 18px 0;
  flex-wrap: wrap;
}
.summary-strip div strong {
  display: block;
  margin-top: 5px;
}
.negative {
  color: var(--red);
}
details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0;
}
.searchline {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}
.searchline input {
  max-width: 350px;
}
.mobile-menu {
  display: none;
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 195px 1fr;
  }
  .page {
    padding: 27px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .personal-cards .featured {
    grid-column: 1 / -1;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .metric {
    font-size: 27px;
  }
  .sidebar {
    padding: 25px 12px;
  }
  .brand {
    font-size: 16px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 15px 12px;
  }
  .sidebar .brand {
    margin: 0 0 14px;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 2px;
  }
  .nav button {
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 12px;
  }
  .nav-icon {
    font-size: 14px;
    width: auto;
  }
  .side-foot {
    display: none;
  }
  .topbar {
    height: 58px;
    padding: 0 18px;
  }
  .page {
    padding: 22px 16px;
  }
  .heading {
    display: block;
    margin-bottom: 20px;
  }
  .heading .toolbar {
    margin-top: 15px;
  }
  h1 {
    font-size: 27px;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 17px 14px;
  }
  .metric {
    font-size: 23px;
  }
  .metric-title {
    font-size: 11px;
  }
  .metric-note {
    line-height: 1.5;
    font-size: 10px;
  }
  .panel {
    padding: 17px 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .row-editor {
    grid-template-columns: 1fr 1fr;
  }
  .row-editor label:first-child {
    grid-column: 1/-1;
  }
  .row-editor button {
    justify-self: end;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .login-wrap {
    display: block;
  }
  .login-brand {
    display: none;
  }
  .login-card {
    min-height: 100vh;
    padding: 30px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input,
  .toolbar select {
    max-width: 100%;
    width: 100%;
  }
  .toolbar label {
    flex: 1;
    min-width: 120px;
  }
  .user .user-name {
    display: none;
  }
  dialog {
    padding: 20px 16px;
    width: calc(100% - 20px);
  }
  .table-wrap {
    max-width: 100%;
  }
  #toast {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }
  .breadcrumb {
    font-size: 10px;
  }
}
.cost-allocation {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  align-items: end;
  gap: 8px;
  margin: 10px 0;
}
.cost-allocation button {
  padding: 10px;
}
@media (max-width: 700px) {
  .cost-allocation {
    grid-template-columns: 1fr 1fr;
  }
  .cost-allocation button {
    grid-column: 2;
    justify-self: end;
  }
}

/* Forms: currencies and commission bases should read like business documents. */
[hidden] {
  display: none !important;
}
.line-number {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.base-picker {
  display: grid;
  gap: 10px;
}
.base-picker .check {
  align-items: start;
}
fieldset {
  min-width: 0;
  border: 1px solid #cedad2;
  border-radius: 12px;
  padding: 16px;
}
legend {
  padding: 0 6px;
  color: #496158;
}
.invalid-row {
  outline: 2px solid #b34236;
  outline-offset: 3px;
}
.form-error:empty {
  display: none;
}
.form-error:not(:empty) {
  padding: 12px 16px;
  margin: 16px 0;
  border: 1px solid #e5bbb6;
  border-radius: 10px;
  background: #fff5f3;
}
.form-error button {
  display: block;
  margin-top: 10px;
}
.detail-grid {
  margin: 18px 0;
}
.detail-item strong {
  overflow-wrap: anywhere;
}

[aria-invalid="true"] {
  border-color: #b42318;
  outline: 2px solid #f6d7d2;
}
.field-error {
  display: block;
  color: #b42318;
  margin-top: 6px;
}
.account-group th {
  background: #eef3eb;
  color: #173f35;
  font-size: 15px;
}
.batch-recipient {
  padding: 16px;
  border: 1px solid var(--line, #d5dfd8);
  border-radius: 12px;
  margin-bottom: 12px;
}
.batch-recipient {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.batch-recipient .remove-recipient {
  justify-self: start;
  align-self: end;
}
@media (max-width: 600px) {
  .batch-recipient {
    grid-template-columns: 1fr;
  }
}
