:root {
  --bg: #f5f6f3;
  --paper: #fff;
  --ink: #202e29;
  --muted: #7a857f;
  --green: #214e40;
  --line: #e5e9e3;
  --accent: #d9ec97;
  --soft: #eef3ed;
  --danger: #ac4141;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
.layout {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 238px;
  background: #fbfcf9;
  border-right: 1px solid var(--line);
  padding: 36px 20px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 750;
  font-size: 27px;
  letter-spacing: -1px;
  padding: 0 12px;
}
.brandmark {
  background: var(--green);
  color: white;
  border-radius: 11px;
  width: 36px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 29px;
}
.brand small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin-top: 4px;
}
.nav-label {
  margin: 46px 15px 12px;
  font-size: 10px;
  letter-spacing: 1.7px;
  color: #98a199;
  font-weight: 600;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  background: none;
  border: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 8px;
  color: #6f7b72;
  font-size: 13px;
}
.nav button.active {
  background: #e8eee4;
  color: #284832;
  font-weight: 650;
}
.nav button:hover {
  background: #eef2eb;
}
.icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  flex-shrink: 0;
  vertical-align: middle;
}
.sidebar-bottom {
  margin-top: auto;
}
.help-card {
  background: #f0f3ea;
  border: 1px solid #e3e8d9;
  border-radius: 10px;
  padding: 16px;
  margin: 24px 0;
}
.help-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 8px 0 12px;
}
.mini-label {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--muted);
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 5px 0;
  border-top: 1px solid var(--line);
}
.avatar {
  display: grid;
  place-items: center;
  background: #e4e9dd;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 11px;
  font-weight: bold;
}
.user strong {
  display: block;
  font-size: 12px;
}
.user small {
  font-size: 11px;
  color: var(--muted);
}
.logout {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 5px;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 78px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 42px;
  background: #fafbf8;
  font-size: 12px;
  color: var(--muted);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 13px;
}
.crumb strong {
  font-weight: 500;
  color: #354c3f;
}
.topright {
  display: flex;
  gap: 18px;
  align-items: center;
}
.live {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #80a75c;
}
.main {
  max-width: 1560px;
  margin: auto;
  padding: 38px 42px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.9px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 29px;
}
h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0;
}
h3 {
  font-size: 15px;
  margin: 0 0 10px;
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: white;
  color: #3e4c43;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.btn:hover {
  background: #f0f3ed;
}
.btn.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
  box-shadow: 0 2px 3px #163c3510;
}
.btn.primary:hover {
  background: #173c30;
}
.btn.danger {
  color: var(--danger);
}
.btn.small {
  padding: 7px 10px;
  font-size: 11px;
}
.btn.ghost {
  background: none;
  border: 0;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 30px;
}
.stat {
  padding: 21px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 137px;
  position: relative;
}
.stat:last-child {
  background: #ecf1e5;
}
.stat label {
  color: #6b776e;
  font-size: 12px;
}
.stat .value {
  font-size: 31px;
  font-weight: 550;
  letter-spacing: -1px;
  margin: 12px 0 7px;
}
.stat small {
  color: #929b94;
  font-size: 11px;
}
.stat .stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  color: #8b978a;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 22px;
  overflow: hidden;
}
.cardhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.cardhead .subtitle {
  font-size: 12px;
  margin-top: 6px;
}
.count {
  font-size: 10px;
  background: #f1f4ed;
  color: #79836f;
  border-radius: 5px;
  padding: 4px 7px;
  margin-left: 8px;
  vertical-align: middle;
}
.filters {
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.filters input,
.filters select {
  width: auto;
  min-width: 0;
  height: 38px;
  font-size: 12px;
  padding: 9px 10px;
}
.searchbox {
  position: relative;
  flex: 1;
  min-width: 210px;
}
.searchbox input {
  width: 100%;
  padding-left: 35px;
}
.searchbox .icon {
  position: absolute;
  left: 10px;
  top: 10px;
  color: #87928a;
  width: 16px;
  height: 16px;
}
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
input,
select,
textarea {
  border: 1px solid #dfe5dc;
  border-radius: 6px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  width: 100%;
  transition: border 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #739779;
  outline: 2px solid #c6dbc559;
}
input::placeholder,
textarea::placeholder {
  color: #9ba49e;
}
textarea {
  resize: vertical;
  min-height: 85px;
}
label.field {
  display: block;
  color: #5a6b5f;
  font-size: 12px;
  margin-bottom: 18px;
}
.field > span {
  display: block;
  margin-bottom: 8px;
}
.field small {
  display: block;
  color: #929c94;
  line-height: 1.6;
  margin-top: 6px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}
th {
  text-align: left;
  padding: 13px 24px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.45px;
  color: #869188;
  background: #fafbf8;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 19px 24px;
  border-bottom: 1px solid #edf0ea;
  font-size: 12px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafcf8;
}
td strong {
  font-size: 12px;
  font-weight: 600;
}
td small {
  display: block;
  color: #94a096;
  font-size: 10px;
  margin-top: 5px;
}
.docnum {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #425e4b;
}
.docicon {
  padding: 8px;
  background: #f0f4ec;
  color: #87997d;
  border: 1px solid #e6ecdf;
  border-radius: 7px;
  display: inline-flex;
}
.badge {
  border-radius: 5px;
  padding: 5px 8px;
  display: inline-block;
  font-size: 10px;
  background: #eaf3e9;
  color: #5b7f50;
}
.badge.neutral {
  background: #f1f1e9;
  color: #87876c;
}
.badge.red {
  background: #fbecec;
  color: #a14747;
}
.tablefoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  color: #96a096;
  font-size: 11px;
}
.empty {
  padding: 55px 24px;
  text-align: center;
  white-space: normal;
}
.empty .icon {
  width: 30px;
  height: 30px;
  color: #8ca17c;
  margin-bottom: 13px;
}
.empty h3 {
  margin-bottom: 9px;
}
.empty p {
  font-size: 12px;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 18px;
  line-height: 1.7;
}
.hint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #879280;
  font-size: 12px;
  line-height: 1.7;
  margin: 22px 4px;
}
.hint .icon {
  color: #91a37f;
  flex-shrink: 0;
}
.pagefooter {
  font-size: 10px;
  color: #a0aaa0;
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}
.formgrid .full {
  grid-column: 1/-1;
}
.pad {
  padding: 24px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}
.section-no {
  border-radius: 50%;
  background: #edf2e8;
  color: #81916e;
  padding: 5px 8px;
  font-size: 10px;
  margin-right: 10px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
  font-size: 12px;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  margin-top: 2px;
}
.check small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.line-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 95px 110px 32px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.line-row .field {
  margin: 0;
}
.remove {
  border: 0;
  background: none;
  padding: 11px 0;
  color: #9aa296;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.8;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary-row span {
  color: var(--muted);
}
.notice {
  padding: 13px 15px;
  background: #f5f6e9;
  border: 1px solid #e8e9d4;
  border-radius: 7px;
  color: #85845a;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.error {
  padding: 12px;
  background: #fff0ee;
  color: #a64237;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0;
}
.error:empty {
  display: none;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-story {
  background: #1e453a;
  color: #fff;
  padding: 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: "";
  width: 500px;
  height: 500px;
  border: 1px solid #ffffff15;
  border-radius: 50%;
  position: absolute;
  bottom: -250px;
  right: -80px;
  box-shadow:
    0 0 0 70px #ffffff04,
    0 0 0 140px #ffffff03;
}
.auth-story .brand {
  padding: 0;
  color: white;
  margin-bottom: 90px;
}
.auth-story .brandmark {
  background: var(--accent);
  color: #264637;
}
.auth-story h1 {
  font-size: 48px;
  line-height: 1.14;
  max-width: 420px;
}
.auth-story p {
  color: #afc2b5;
  line-height: 1.8;
  max-width: 370px;
}
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px;
}
.auth-form form {
  width: 100%;
  max-width: 360px;
}
.auth-form h2 {
  font-size: 26px;
  margin-bottom: 10px;
}
.auth-form .subtitle {
  margin-bottom: 28px;
}
.auth-form .btn {
  width: 100%;
  margin-top: 10px;
}
.auth-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 28px;
  line-height: 1.7;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  width: 650px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 25px 100px #18362925;
}
dialog::backdrop {
  background: #18312555;
  backdrop-filter: blur(2px);
}
.modalhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}
.modalbody {
  padding: 25px;
}
.modalfoot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px 25px;
  border-top: 1px solid var(--line);
  background: #fafbf7;
}
#toast {
  position: fixed;
  right: 28px;
  bottom: 25px;
  background: #244c3c;
  color: white;
  box-shadow: 0 8px 25px #0002;
  padding: 16px 23px;
  border-radius: 8px;
  z-index: 10;
  font-size: 13px;
  display: none;
}
#toast.show {
  display: block;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.detail-grid p {
  font-size: 12px;
  line-height: 1.8;
  color: #758376;
  margin: 7px 0;
  white-space: pre-line;
}
.detail-grid label {
  font-size: 10px;
  color: #919d90;
  letter-spacing: 1px;
}
.import-box {
  border: 1px dashed #b5c4aa;
  background: #f9fbf5;
  border-radius: 9px;
  padding: 24px;
  text-align: center;
  margin: 18px 0;
}
.import-box input {
  margin-top: 15px;
  background: white;
}
.audit {
  font-size: 12px;
  line-height: 1.7;
}
.audit div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1500px) {
  .main {
    padding-top: 46px;
  }
  .stats {
    gap: 22px;
  }
  .stat {
    min-height: 150px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 200px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .layout {
    grid-template-columns: 200px 1fr;
  }
  .main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 17px;
  }
  .stat .stat-icon {
    display: none;
  }
  td,
  th {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 760px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 23px;
  }
  .brandmark {
    width: 30px;
    height: 32px;
  }
  .nav-label,
  .help-card,
  .sidebar-bottom,
  .topright {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    margin-top: 20px;
    gap: 2px;
  }
  .nav button {
    white-space: nowrap;
    padding: 10px;
    font-size: 11px;
  }
  .nav button .icon {
    width: 16px;
  }
  .topbar {
    height: 52px;
    padding: 0 18px;
  }
  .main {
    padding: 24px 16px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 27px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat {
    min-height: 120px;
  }
  .filters {
    padding: 15px;
  }
  .date-range {
    width: 100%;
  }
  .date-range input {
    width: 45%;
  }
  .cardhead {
    padding: 18px;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .formgrid .full {
    grid-column: auto;
  }
  .line-row {
    grid-template-columns: 1fr 68px 83px 23px;
    gap: 6px;
  }
  .line-row input,
  .line-row select {
    padding: 10px 7px;
    font-size: 11px;
  }
  .pad {
    padding: 18px;
  }
  .auth {
    display: block;
  }
  .auth-story {
    padding: 30px;
  }
  .auth-story .brand {
    margin-bottom: 25px;
  }
  .auth-story h1 {
    font-size: 30px;
  }
  .auth-story p {
    display: none;
  }
  .auth-form {
    padding: 32px 24px;
  }
  .pagefooter {
    line-height: 1.7;
    gap: 20px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.mobile-logout {
  display: none;
}
@media (max-width: 760px) {
  .mobile-logout {
    display: inline-flex;
  }
}
.brand small {
  font-size: 8px;
  letter-spacing: 1.5px;
  white-space: nowrap;
}
.brand {
  gap: 9px;
  font-size: 25px;
}
.brandmark {
  flex-shrink: 0;
}
#note-table table {
  white-space: normal;
  min-width: 850px;
}
#note-table td,
#note-table th {
  padding-left: 13px;
  padding-right: 13px;
}
#note-table td:first-child,
#note-table td:nth-child(3),
#note-table td:nth-child(4),
#note-table td:nth-child(5) {
  white-space: nowrap;
}
#note-table td:nth-child(2) {
  min-width: 135px;
}
#note-table td:nth-child(6) {
  max-width: 140px;
  line-height: 1.5;
}
#note-table .docicon {
  padding: 6px;
}
#note-table .docnum {
  gap: 7px;
}
