@media screen {
  :root {
    --bg: #f4f3ed;
    --card: #fffdf8;
    --ink: #17231f;
    --ink2: #53635d;
    --ink3: #8d9a94;
    --line: #e9ebe4;
    --line2: #dfe4dc;
    --brand: #146c57;
    --brand-soft: #e7f2ed;
    --brand-line: #c8e2d7;
    --in: #147a5c;
    --in-soft: #e5f5ee;
    --out: #c74b3c;
    --out-soft: #faece8;
    --warn: #b16b24;
    --warn-soft: #fbf1e4;
    --shadow: 0 1px 1px rgba(23, 35, 31, .03), 0 16px 36px -28px rgba(23, 35, 31, .42);
    --shadow-2: 0 2px 4px rgba(23, 35, 31, .04), 0 26px 60px -38px rgba(23, 35, 31, .5);
  }

  html {
    background: #e7e8e1;
  }

  body {
    background:
      radial-gradient(circle at 10% 2%, rgba(20, 108, 87, .08), transparent 30rem),
      #e7e8e1;
    color: var(--ink);
    letter-spacing: -.01em;
  }

  #app {
    box-shadow: 0 0 0 1px rgba(23, 35, 31, .03), 0 30px 90px -48px rgba(23, 35, 31, .48);
    background: var(--bg);
  }

  main {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .3), transparent 190px),
      var(--bg);
  }

  .top {
    padding-top: 26px;
    align-items: center;
  }

  .top h1 {
    font-size: 29px;
    line-height: 1.05;
    font-weight: 780;
    letter-spacing: -1.35px;
  }

  .top h1::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 9px;
    border-radius: 50%;
    background: #df7d3f;
    vertical-align: 8px;
    box-shadow: 0 0 0 5px rgba(223, 125, 63, .13);
  }

  .top .sub {
    color: #84928c;
    font-size: 12.5px;
    letter-spacing: .01em;
  }

  .top .sub b {
    color: #43524c;
  }

  .icon-btn {
    border-color: #dce1d8;
    background: rgba(255, 253, 248, .88);
    color: #41514b;
    box-shadow: 0 1px 2px rgba(23, 35, 31, .03);
  }

  .icon-btn:hover {
    border-color: #bccbc4;
    color: var(--brand);
    transform: translateY(-1px);
  }

  .icon-btn.brand {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 12px 24px -17px rgba(20, 108, 87, .95);
  }

  .search {
    margin-top: 17px;
  }

  .search input {
    height: 49px;
    border-color: #dce2d9;
    background: rgba(255, 253, 248, .9);
    border-radius: 15px;
    font-size: 15px;
    box-shadow: 0 1px 1px rgba(23, 35, 31, .02);
  }

  .search input:focus {
    border-color: #a8cfc1;
    box-shadow: 0 0 0 4px rgba(20, 108, 87, .09);
    background: #fffefa;
  }

  .search .clr {
    background: #edf2ee;
  }

  .stats {
    gap: 9px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .stat {
    min-width: 0;
    padding: 14px 13px;
    border: 1px solid #dee4da;
    border-radius: 15px;
    background: rgba(255, 253, 248, .93);
    box-shadow: 0 1px 1px rgba(23, 35, 31, .025);
  }

  .stat + .stat {
    border-left: 1px solid #dee4da;
  }

  .stat:nth-child(1) {
    background: #17372e;
    border-color: #17372e;
  }

  .stat:nth-child(1) .k,
  .stat:nth-child(1) .v,
  .stat:nth-child(1) .v small {
    color: #fff;
  }

  .stat:nth-child(1) .k {
    color: rgba(255, 255, 255, .62);
  }

  .stat .k {
    font-size: 10.5px;
    letter-spacing: .06em;
  }

  .stat .v {
    margin-top: 8px;
    font-size: 23px;
    font-weight: 760;
  }

  .filterbar {
    gap: 7px;
    margin-top: 2px;
  }

  .fpill,
  .fsort {
    height: 35px;
    border-color: #dae1d7;
    border-radius: 11px;
    background: rgba(255, 253, 248, .9);
    color: #53635d;
  }

  .fpill.on {
    background: var(--brand-soft);
    border-color: #bcdccf;
  }

  .fpill.on b,
  .fpill.on svg {
    color: var(--brand);
  }

  .item {
    position: relative;
    border-color: #dfe4da;
    border-radius: 17px;
    padding: 15px 16px;
    background: rgba(255, 253, 248, .96);
    box-shadow: 0 1px 1px rgba(23, 35, 31, .02);
    overflow: hidden;
  }

  .item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #c8d8d0;
    opacity: 0;
    transition: opacity .15s;
  }

  .item:hover {
    border-color: #c8d4cb;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
  }

  .item:hover::before {
    opacity: 1;
  }

  .item.low::before {
    opacity: 1;
    background: #e0a35f;
  }

  .item.zero::before {
    opacity: 1;
    background: #d55a49;
  }

  .item .name {
    font-size: 15px;
    font-weight: 680;
  }

  .item .qty {
    font-size: 22px;
    font-weight: 760;
    color: #1a2e27;
  }

  .item .links .k-c,
  .item .links .k-s {
    background: #eef3ef;
    color: #4e6d60;
  }

  .item .meta .bt,
  .sq-item .log .nm .lg-code {
    background: #eef2ed;
    color: #57665f;
  }

  .log,
  .alert,
  .ck-row {
    border-color: #dfe4da;
    border-radius: 15px;
    background: rgba(255, 253, 248, .96);
  }

  .log:hover {
    border-color: #c8d4cb;
    box-shadow: 0 10px 28px -26px rgba(23, 35, 31, .62);
  }

  .log .ico {
    border-radius: 10px;
  }

  .daylabel {
    color: #7d8c85;
    letter-spacing: .06em;
  }

  .panel {
    border-color: #dfe4da;
    border-radius: 18px;
    background: rgba(255, 253, 248, .96);
  }

  .hero-card {
    background:
      radial-gradient(circle at 88% 8%, rgba(218, 132, 71, .36), transparent 15rem),
      linear-gradient(145deg, #112d26 0%, #174537 70%, #1c5040 100%);
    box-shadow: 0 24px 48px -34px rgba(17, 45, 38, .9);
  }

  .hero-card .amt {
    letter-spacing: -1.8px;
  }

  .bar i {
    background: linear-gradient(90deg, #78b09d, #146c57);
  }

  .primary {
    background: var(--brand);
    border-radius: 14px;
  }

  .primary.in {
    background: #147a5c;
  }

  .primary.out {
    background: #c74b3c;
  }

  .btn-sm {
    background: #213b32;
    border-radius: 10px;
  }

  .btn-sm.dark {
    background: #213b32;
  }

  .tabbar-inner {
    padding: 7px;
    border-radius: 22px;
    border-color: rgba(23, 35, 31, .08);
    background: rgba(255, 253, 248, .92);
    box-shadow: 0 18px 38px -17px rgba(23, 35, 31, .38);
  }

  .tab {
    color: #87948e;
    border-radius: 15px;
  }

  .tab.on {
    background: #1a332b;
    color: #fff;
  }

  .tab.on .dot {
    border-color: #1a332b;
  }

  #sheet-root .sheet {
    border: 1px solid rgba(23, 35, 31, .08);
    background: #fffdf8;
  }

  .seg {
    background: #eef1eb;
  }

  .seg button.on {
    box-shadow: 0 2px 7px rgba(23, 35, 31, .1);
  }

  .field input,
  .field select,
  .qty-input {
    background: #f8f8f3;
    border-color: #dde3d9;
  }

  .field input:focus,
  .field select:focus,
  .qty-input:focus {
    border-color: #a8cfc1;
    background: #fffefa;
  }

  .add-row {
    border-color: #ccd9d1;
    background: rgba(255, 253, 248, .6);
    color: #718078;
    border-radius: 16px;
  }

  .add-row:hover {
    border-color: #a9c6b9;
    color: var(--brand);
  }

  #toast.show {
    box-shadow: 0 15px 40px -24px rgba(23, 35, 31, .7);
  }

  @media (min-width: 900px) {
    body {
      background:
        radial-gradient(circle at 4% 4%, rgba(20, 108, 87, .12), transparent 34rem),
        #e7e8e1;
    }

    #app {
      max-width: 1360px;
      grid-template-columns: 252px minmax(0, 1fr);
      min-height: calc(100dvh - 28px);
      margin: 14px auto;
      border-radius: 24px;
      overflow: hidden;
    }

    .side {
      padding: 28px 18px 20px;
      color: rgba(255, 255, 255, .78);
      background:
        radial-gradient(circle at 20% 0%, rgba(83, 152, 127, .22), transparent 18rem),
        #122a23;
      border-right: 0;
    }

    .side-brand {
      padding: 0 6px 28px;
    }

    .side-brand .logo {
      width: 42px;
      height: 42px;
      border-radius: 13px;
      background: #df7d3f;
      color: #17231f;
      box-shadow: 0 10px 26px -16px rgba(223, 125, 63, .8);
    }

    .side-brand b {
      color: #fff;
      font-size: 16px;
    }

    .side-brand span,
    .side-brand span em {
      color: rgba(255, 255, 255, .52);
    }

    .side-nav {
      gap: 5px;
    }

    .side-nav .tab {
      color: rgba(255, 255, 255, .58);
      border-radius: 12px;
      padding: 11px 13px;
    }

    .side-nav .tab:hover:not(.on) {
      color: #fff;
      background: rgba(255, 255, 255, .07);
    }

    .side-nav .tab.on {
      color: #fff;
      background: rgba(255, 255, 255, .12);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    }

    .side-nav .tab.on svg {
      color: #efad7b;
    }

    .side-add {
      height: 43px;
      border-radius: 12px;
      color: #17231f;
      background: #df7d3f;
      box-shadow: 0 12px 25px -18px rgba(223, 125, 63, .9);
    }

    .side-sync,
    .side-link {
      color: rgba(255, 255, 255, .52);
    }

    .side-link:hover,
    .side-link.on {
      color: #efad7b;
    }

    main {
      min-height: calc(100dvh - 28px);
      padding: 34px 42px 64px;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, .36), transparent 220px),
        var(--bg);
    }

    .top {
      padding: 0 0 20px;
    }

    .top h1 {
      font-size: 33px;
    }

    .stats {
      margin-bottom: 19px;
    }

    .stat {
      padding: 16px 18px;
    }

    .stat .v {
      font-size: 27px;
    }

    #list {
      gap: 13px;
    }

    .item {
      padding: 16px 17px;
    }

    #sheet-root .sheet {
      max-width: 600px;
      max-height: 88vh;
    }
  }
}

html.standalone-auth-pending #app,
html.standalone-auth-pending .tabbar,
html.standalone-auth-pending #sheet-root,
html.standalone-auth-pending #printDoc {
  visibility: hidden !important;
}

#standalone-auth {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #17231f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#standalone-auth .sa-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(72, 148, 120, .34), transparent 32rem),
    radial-gradient(circle at 90% 90%, rgba(223, 125, 63, .16), transparent 28rem),
    #10261f;
}

#standalone-auth .sa-card {
  position: relative;
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 25px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(20px);
}

#standalone-auth .sa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  font-size: 15px;
  font-weight: 750;
}

#standalone-auth .sa-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #17231f;
  background: #df7d3f;
  font-size: 17px;
}

#standalone-auth .sa-kicker {
  color: #7c8b84;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .16em;
}

#standalone-auth h1 {
  margin: 9px 0 10px;
  color: #17231f;
  font-size: 30px;
  font-weight: 790;
  letter-spacing: -1.2px;
}

#standalone-auth .sa-lead {
  margin: 0 0 23px;
  color: #697871;
  font-size: 13.5px;
  line-height: 1.7;
}

#standalone-auth .sa-message {
  margin: -7px 0 16px;
  padding: 10px 12px;
  border: 1px solid #efd3cb;
  border-radius: 10px;
  background: #fcedea;
  color: #b64537;
  font-size: 12.5px;
}

#standalone-auth label {
  display: block;
  margin-bottom: 14px;
}

#standalone-auth label span {
  display: block;
  margin-bottom: 7px;
  color: #53635d;
  font-size: 11.5px;
  font-weight: 680;
}

#standalone-auth input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid #dce2d8;
  border-radius: 12px;
  outline: 0;
  background: #f8f8f3;
  color: #17231f;
  font: inherit;
  font-size: 16px;
}

#standalone-auth input:focus {
  border-color: #93c2af;
  background: #fffefa;
  box-shadow: 0 0 0 4px rgba(20, 108, 87, .09);
}

#standalone-auth .sa-submit {
  width: 100%;
  height: 49px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #146c57;
  box-shadow: 0 15px 28px -18px rgba(20, 108, 87, .9);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#standalone-auth .sa-submit:hover {
  background: #0f5b49;
}

#standalone-auth .sa-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 21px;
  color: #84918b;
  font-size: 10.5px;
}

#standalone-auth .sa-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36a27c;
  box-shadow: 0 0 0 4px rgba(54, 162, 124, .12);
}

@media (max-width: 520px) {
  #standalone-auth {
    align-items: end;
    padding: 0;
  }

  #standalone-auth .sa-card {
    width: 100%;
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
    border-radius: 25px 25px 0 0;
    border-bottom: 0;
  }

  #standalone-auth .sa-brand {
    margin-bottom: 28px;
  }
}

@media print {
  #standalone-auth {
    display: none !important;
  }
}
