:root {
  --bg: #f4f5f1;
  --paper: #fff;
  --ink: #24332f;
  --muted: #6c7871;
  --line: #dfe5df;
  --green: #1c574c;
  --green-soft: #e9f2ec;
  --amber: #925c12;
  --amber-soft: #fff4de;
  --red: #ab3e36;
  --red-soft: #fceeea;
  --shadow: 0 12px 36px #183b2d0a;
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.hidden {
  display: none !important;
}
.topbar {
  background: #173b3a;
  color: #fff;
}
.top-inner {
  max-width: 1280px;
  margin: auto;
  min-height: 84px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: #abc9bd;
  margin-top: 7px;
}
.top-inner nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.nav-btn {
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px 15px;
  color: #c4d6cf;
  font-weight: 600;
}
.nav-btn.active,
.nav-btn:hover {
  color: #fff;
  background: #ffffff16;
}
a.nav-btn { display: inline-block; text-decoration: none; }
#account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.user-meta {
  text-align: right;
}
.user-meta small {
  display: block;
  color: #b2cdc1;
}
.logout {
  background: transparent;
  color: #d8e7e0;
  border: 1px solid #ffffff35;
  border-radius: 7px;
  padding: 8px 12px;
}
#main {
  max-width: 1280px;
  margin: auto;
  min-height: calc(100vh - 152px);
  padding: 32px;
}
.loading {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
footer {
  max-width: 1280px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
#footerVersion {
  white-space: nowrap;
}
#footerCopyright {
  margin-left: auto;
  text-align: right;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
h3 {
  font-size: 15px;
  margin-bottom: 12px;
}
p {
  color: var(--muted);
  margin-bottom: 16px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 750;
  margin-bottom: 12px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading p {
  margin-bottom: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 11px 17px;
  border-radius: 8px;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.btn.soft {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}
.btn.danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn.small {
  min-height: 34px;
  font-size: 12px;
  padding: 7px 11px;
}
.btn.wide {
  width: 100%;
}
.text-btn {
  border: 0;
  background: none;
  color: var(--green);
  padding: 5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  min-width: 36px;
  min-height: 36px;
  font-size: 21px;
  color: var(--muted);
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card.pad {
  padding: 24px;
}
.card-head {
  flex-wrap: wrap;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.card-head h2,
.card-head h3 {
  margin: 0;
}
.card + .card {
  margin-top: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.field small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid #d5ddd5;
  border-radius: 7px;
  padding: 11px 12px;
  min-height: 44px;
}
input::placeholder,
textarea::placeholder {
  color: #9ba49e;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #badace;
  outline-offset: 1px;
  border-color: var(--green);
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--green);
  flex: none;
}
input[type="file"] {
  padding: 15px;
  background: #f7f9f6;
  border-style: dashed;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.actions.end {
  justify-content: flex-end;
}
.help {
  font-size: 12px;
  color: var(--muted);
}
.hint {
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--green-soft);
  font-size: 13px;
  color: var(--green);
}
.notice {
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 16px;
}
.notice.bad {
  background: var(--red-soft);
  color: var(--red);
}
.form-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters input {
  flex: 1;
  min-width: 180px;
  max-width: 420px;
}
.filters select {
  width: auto;
  min-width: 170px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
th {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8faf7;
  font-weight: 650;
  padding: 13px 18px;
  white-space: nowrap;
}
td {
  padding: 16px 18px;
  border-top: 1px solid #edf0eb;
  vertical-align: middle;
}
td strong {
  font-weight: 600;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tr[data-open] {
  cursor: pointer;
}
tr[data-open]:hover {
  background: #f7faf7;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 8px;
  background: var(--green-soft);
  color: var(--green);
}
.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.red {
  background: var(--red-soft);
  color: var(--red);
}
.badge.gray {
  background: #edf0eb;
  color: var(--muted);
}
.empty {
  padding: 60px 24px;
  text-align: center;
}
.empty h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.empty p {
  font-size: 13px;
  margin-bottom: 0;
}
.pagination {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.login-layout {
  max-width: 960px;
  margin: 55px auto;
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 80px;
  align-items: center;
}
.login-intro h1 {
  font-size: 44px;
  letter-spacing: -1.7px;
  line-height: 1.12;
  max-width: 370px;
  margin-bottom: 22px;
}
.login-intro p {
  font-size: 16px;
  max-width: 370px;
}
.intro-step {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 21px 0;
  font-size: 13px;
}
.intro-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #e0e9df;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 650;
  color: var(--green);
}
.login-card {
  padding: 30px;
}
.login-card p {
  font-size: 13px;
  margin: 8px 0 24px;
}
.login-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.back-link {
  margin-bottom: 18px;
  display: inline-flex;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.section-note {
  font-size: 13px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.stat b {
  display: block;
  font-size: 31px;
  font-weight: 650;
  line-height: 1.2;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.stat.warn b {
  color: var(--amber);
}
.stat.bad b {
  color: var(--red);
}
.scan-card {
  padding: 22px 24px;
  border-top: 3px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 8px 20px #173b3a0a;
}
.scan-line {
  display: flex;
  gap: 10px;
  align-items: center;
}
.scan-line input {
  font-size: 20px;
  font-family: "Consolas", monospace;
  flex: 1;
}
.scan-line .btn {
  min-height: 50px;
}
.scan-feedback {
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 21px;
  color: var(--green);
}
.scan-feedback.bad {
  color: var(--red);
}
.scan-feedback.warn {
  color: var(--amber);
}
.scan-tools {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.scan-tools button {
  font-size: 12px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
}
.scan-card video {
  display: block;
  width: 100%;
  max-height: 220px;
  margin-top: 14px;
  border-radius: 7px;
  background: #152824;
}
.progress-row {
  margin: 14px 0 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
}
progress {
  appearance: none;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  width: 100%;
  height: 7px;
  background: #e0e8de;
}
progress::-webkit-progress-bar {
  background: #e0e8de;
}
progress::-webkit-progress-value {
  background: var(--green);
}
progress::-moz-progress-bar {
  background: var(--green);
}
.progress-row span {
  white-space: nowrap;
}
.item-table {
  min-width: 750px;
}
.item-table tr.exact td {
  background: #f5faf5;
}
.item-table tr.extra td {
  background: #fff7f4;
}
.barcode {
  font-family: Consolas, monospace;
  font-size: 12px;
  max-width: 230px;
  overflow-wrap: anywhere;
}
.receipt-bottom {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.receipt-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
#receiversCard {
  margin-bottom: 16px;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.admin-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 550;
}
.admin-tabs button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.settings-layout {
  max-width: 850px;
}
.settings-layout .card {
  margin-bottom: 20px;
}
.settings-layout .card h2 {
  margin-bottom: 20px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.check-row input {
  margin-top: 3px;
}
.check-row label {
  font-size: 13px;
  font-weight: 600;
}
.check-row small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: 560px;
  max-width: calc(100vw - 28px);
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 24px 100px #0003;
}
dialog::backdrop {
  background: #10262270;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  gap: 15px;
}
.dialog-top h2 {
  margin: 0;
}
#dialogBody {
  padding: 24px;
}
#dialogBody textarea.mail-body {
  min-height: 260px;
  font-size: 13px;
  font-family: inherit;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 21px;
  background: #173b3a;
  color: #fff;
  border-radius: 9px;
  box-shadow: 0 6px 28px #0002;
  z-index: 100;
  font-size: 13px;
  max-width: calc(100vw - 30px);
}
.toast.error {
  background: var(--red);
}
.queue-banner {
  background: var(--amber-soft);
  border-bottom: 1px solid #efdfbd;
  padding: 10px 32px;
  font-size: 12px;
  text-align: center;
  color: var(--amber);
}
.queue-banner button {
  font-size: 12px;
  margin-left: 10px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.sample-table {
  min-width: 600px;
}
.sample-table td {
  padding: 9px 12px;
  max-width: 220px;
  overflow-wrap: anywhere;
}
.sample-table th {
  padding: 10px 12px;
}
.muted {
  color: var(--muted);
}
.inline-code {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}
.finished-banner {
  padding: 22px 24px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  margin-bottom: 20px;
}
.finished-banner.bad {
  background: var(--red-soft);
  color: var(--red);
}
.finished-banner h2 {
  color: inherit;
  margin-bottom: 5px;
}
.finished-banner p {
  margin: 0;
  color: inherit;
  font-size: 13px;
}
.log-list {
  max-height: 300px;
  overflow: auto;
}
.log-item {
  padding: 12px 20px;
  border-top: 1px solid #edf0eb;
  font-size: 12px;
  display: flex;
  gap: 20px;
}
.log-item time {
  flex: none;
  color: var(--muted);
  min-width: 130px;
}
.log-item strong {
  font-weight: 600;
}
.log-item small {
  color: var(--muted);
  display: block;
}
.file-name {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.new-layout {
  max-width: 920px;
  margin: auto;
}
.new-layout .card {
  margin-bottom: 22px;
}
.settings-save {
  position: sticky;
  bottom: 12px;
  background: #ffffffee;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  align-items: center;
  backdrop-filter: blur(10px);
}
.settings-save span {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .top-inner {
    gap: 20px;
    padding: 14px 20px;
  }
  #main {
    padding: 24px 20px;
  }
  .login-layout {
    gap: 35px;
    grid-template-columns: 1fr 380px;
    margin: 35px auto;
  }
  .login-intro h1 {
    font-size: 36px;
  }
  .user-meta {
    display: none;
  }
  .grid4 {
    grid-template-columns: 1fr 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 14px;
  }
  .stat b {
    font-size: 27px;
  }
  td,
  th {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media (max-width: 620px) {
  .top-inner {
    min-height: 74px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 21px;
  }
  .brand-sub {
    font-size: 8px;
  }
  .top-inner nav {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    gap: 6px;
  }
  .nav-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  #account {
    gap: 7px;
  }
  .logout {
    font-size: 11px;
    padding: 7px 9px;
  }
  #main {
    padding: 24px 15px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 21px;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .page-heading > .btn {
    font-size: 12px;
    padding: 10px 12px;
  }
  .login-layout {
    display: block;
    margin: 18px auto;
    max-width: 410px;
  }
  .login-intro {
    margin-bottom: 24px;
  }
  .login-intro h1 {
    font-size: 33px;
    max-width: none;
    margin-bottom: 12px;
  }
  .login-intro p {
    font-size: 14px;
    max-width: none;
  }
  .intro-step {
    display: none;
  }
  .login-card {
    padding: 25px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .card.pad {
    padding: 18px;
  }
  .card-head {
    padding: 16px 18px;
  }
  .filters {
    gap: 9px;
  }
  .filters input {
    max-width: none;
    width: 100%;
    flex-basis: 100%;
  }
  .filters select {
    flex: 1;
    min-width: 100px;
    font-size: 12px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    margin: 15px 0;
    gap: 10px;
  }
  .stat b {
    font-size: 27px;
  }
  .stat .label {
    font-size: 10px;
  }
  .stat {
    padding: 13px 15px;
  }
  .scan-card {
    padding: 16px;
    top: 0;
  }
  .scan-line input {
    font-size: 17px;
  }
  .scan-line .btn {
    font-size: 12px;
    padding: 10px 12px;
    min-height: 48px;
  }
  .scan-tools {
    gap: 10px;
  }
  .scan-feedback {
    font-size: 12px;
  }
  .receipt-bottom .btn {
    font-size: 12px;
  }
  .log-item {
    gap: 10px;
    display: block;
  }
  .log-item time {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
  }
  footer {
    padding: 16px;
    font-size: 11px;
  }
  .pagination {
    padding: 13px;
    font-size: 11px;
  }
  .admin-tabs {
    gap: 6px;
    margin-bottom: 18px;
  }
  .admin-tabs button {
    font-size: 12px;
    padding: 9px 11px;
  }
  .queue-banner {
    padding: 10px 14px;
  }
  .settings-save {
    bottom: 8px;
    padding: 12px;
  }
  .settings-save span {
    display: none;
  }
  .dialog-top,
  #dialogBody {
    padding: 18px;
  }
  .receipt-bottom {
    gap: 10px;
  }
  .table-wrap {
    overscroll-behavior-x: contain;
  }
}

#storeMailTestResult:empty{display:none}#storeMailTestResult:not(:empty){margin-top:12px;overflow-wrap:anywhere}

.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.import-head h2 { margin: 0; }
.import-head > .btn { margin-left: auto; }
.scan-sound-note { color: var(--muted); font-size: 12px; }
.mail-help-actions { margin: 12px 0; }
#mailFeedback { margin: 12px 0; }
@media (pointer: fine) { .touch-keyboard { display: none; } }
