:root {
  --green: #214f42;
  --ink: #263d34;
  --muted: #7a877f;
  --line: #e1e7e1;
  --bg: #f4f6f2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.65 system-ui,
    -apple-system,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #d8e1d9;
  background: white;
  color: var(--ink);
  border-radius: 7px;
  padding: 8px 13px;
}
button:hover {
  background: #edf3ea;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #183e32;
}
.danger {
  color: #b4483c;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.error {
  color: #ae3e34;
  white-space: pre-wrap;
}
.brand {
  font-size: 22px;
  font-weight: 700;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: #91b5a1;
  margin-top: 5px;
}
.badge {
  display: inline-block;
  background: #eaf2e5;
  color: #567246;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
}
.badge.warn {
  background: #fff1d7;
  color: #996e20;
}
.badge.blue {
  background: #e9effb;
  color: #516ca1;
}
.badge.grey {
  background: #ecefec;
  color: #7b887c;
}
.sidebar {
  position: fixed;
  width: 210px;
  inset: 0 auto 0 0;
  background: #173f35;
  color: #f4f8f3;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar .brand {
  padding: 0 12px 28px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav button {
  text-align: left;
  padding: 12px 15px;
  border: 0;
  background: transparent;
  color: #bcd1c3;
}
.sidebar nav button.active {
  background: #315748;
  color: white;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 15px 12px;
  font-size: 12px;
  color: #bcd1c3;
}
.sidebar-bottom button {
  margin-top: 12px;
  background: transparent;
  border-color: #4a6e5b;
  color: #bcd1c3;
}
.workspace {
  margin-left: 210px;
  padding: 30px 35px 60px;
  min-height: 100vh;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 5px 0;
}
h2 {
  font-size: 19px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
.eyebrow {
  margin: 0;
  color: #8b998b;
  font-size: 11px;
  letter-spacing: 1px;
}
.header-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: white;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 7px;
  color: var(--green);
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}
.toolbar label {
  margin: 0;
  min-width: 125px;
}
.toolbar .wide {
  flex: 1;
  min-width: 240px;
}
label {
  display: block;
  font-size: 12px;
  color: #6a786c;
  margin: 12px 0;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d9e2d9;
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  margin-top: 6px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #9dc4aa;
  outline-offset: 1px;
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  background: white;
}
th {
  font-weight: 500;
  color: #778274;
  background: #f5f7f2;
  white-space: nowrap;
  text-align: left;
}
td,
th {
  padding: 12px 13px;
  border-bottom: 1px solid #e8ece5;
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafbf7;
}
td.product-cell {
  min-width: 235px;
  max-width: 350px;
}
td.note-cell {
  min-width: 165px;
  max-width: 250px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.product-name {
  font-size: 13px;
  font-weight: 600;
}
.code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.prices {
  min-width: 110px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 112px;
}
.row-actions button {
  padding: 4px 8px;
  font-size: 11px;
}
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 13px;
}
.section-head h2 {
  margin: 0;
}
.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 18px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.platform-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}
.notice {
  padding: 12px 15px;
  background: #f2f6ec;
  color: #6e7f60;
  border-radius: 8px;
  font-size: 12px;
  margin: 14px 0;
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}
.cart-qty {
  width: 72px;
  padding: 5px;
  margin: 0;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs button.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(1000px, 94vw);
  max-height: 92vh;
  padding: 25px;
  box-shadow: 0 25px 80px #0b2e3440;
  color: var(--ink);
}
dialog::backdrop {
  background: #10251d66;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-head button {
  border: 0;
  font-size: 23px;
  padding: 0 10px;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  padding: 14px 22px;
  background: #214f42;
  color: white;
  border-radius: 9px;
  box-shadow: 0 8px 25px #1b382533;
  z-index: 100;
  max-width: 85vw;
}
.mail-preview {
  background: white;
  border: 1px solid var(--line);
  padding: 24px;
  white-space: normal;
}
.mail-preview table {
  margin-top: 20px;
}
.mail-preview td,
.mail-preview th {
  border: 1px solid #d5ded3;
}
.history-diff {
  white-space: pre-wrap;
  font-size: 12px;
  max-width: 420px;
  overflow-wrap: anywhere;
}
.status-line {
  display: flex;
  gap: 6px;
  align-items: center;
}
.login-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-intro {
  background: #173f35;
  color: white;
  padding: 65px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-intro .brand {
  margin-bottom: 70px;
}
.login-intro h1 {
  font-size: 40px;
  line-height: 1.5;
}
.login-intro p {
  color: #b3cbb9;
}
.login-card {
  align-self: center;
  justify-self: center;
  width: min(440px, 90%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 35px;
}
.login-card label {
  font-size: 14px;
}
.login-card .primary {
  width: 100%;
  margin-top: 15px;
}
.password-box {
  position: relative;
}
.password-box input {
  padding-right: 65px;
}
.password-box button {
  position: absolute;
  right: 5px;
  top: 5px;
  border: 0;
  padding: 5px 10px;
}
.login-card .check {
  margin-top: 18px;
  font-size: 12px;
}
.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}
.pill {
  padding: 3px 8px;
  background: #edf2e8;
  border-radius: 30px;
  font-size: 11px;
}
.timeline {
  border-left: 2px solid #cadcc5;
  padding-left: 18px;
  margin-left: 6px;
}
.timeline article {
  margin: 18px 0;
}
.message {
  padding: 13px;
  background: #f6f8f2;
  margin: 10px 0;
  border-radius: 8px;
  white-space: pre-wrap;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  .workspace {
    padding: 25px 20px;
  }
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .header-actions #last-sync {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .sidebar .brand {
    padding: 0 0 12px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 8px;
  }
  .sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0 0;
  }
  .sidebar-bottom button {
    margin: 0;
  }
  .workspace {
    margin: 0;
    padding: 20px 12px;
  }
  header {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 25px;
  }
  .login-intro .brand {
    margin-bottom: 15px;
  }
  .login-intro h1 {
    font-size: 27px;
  }
  .login-card {
    margin: 25px 0;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  dialog {
    padding: 16px;
  }
  .toolbar label {
    flex: 1;
  }
  .row-actions {
    min-width: 90px;
  }
}
