:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #26342c;
  background: #f5f7f8;
  --green: #3f6048;
  --line: #e5e9e7;
  --muted: #7c8780;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s;
}
button:hover {
  background: #304d39;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ghost {
  background: #fff;
  border-color: #dfe5e1;
  color: #536157;
}
.ghost:hover {
  background: #f0f4f1;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #acc5b0;
  outline-offset: 2px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce3de;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: #26342c;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #799783;
  box-shadow: 0 0 0 3px #3f604810;
}
textarea {
  resize: vertical;
  line-height: 1.65;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  margin: 16px 0;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 25px;
}
h2 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
p,
.muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
p {
  margin-bottom: 16px;
}
[hidden] {
  display: none !important;
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 224px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 32px;
}
.brand-mark,
.login-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3f6048;
  color: #fff;
  font-weight: 650;
  border-radius: 10px;
}
.brand-mark {
  width: 38px;
  height: 40px;
  font-size: 22px;
}
.brand strong {
  font-size: 16px;
  display: block;
  letter-spacing: 0.2px;
}
.brand div > span {
  font-size: 11px;
  color: #8f9892;
  display: block;
  margin-top: 5px;
}
.nav-label {
  font-size: 11px;
  color: #9aa29d;
  padding: 0 28px 14px;
}
nav {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
nav button {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  background: transparent;
  color: #66716a;
  font-weight: 500;
  border-radius: 7px;
}
nav button:hover {
  background: #f5f7f5;
  color: #334c3b;
}
nav button.selected {
  background: #ecf2ed;
  color: #365840;
  font-weight: 650;
}
.nav-icon {
  font-size: 20px;
  line-height: 20px;
  width: 22px;
  text-align: center;
  color: #8b988d;
}
.selected .nav-icon {
  color: #48704f;
}
.nav-arrow {
  margin-left: auto;
  font-size: 19px;
  opacity: 0;
}
.selected .nav-arrow {
  opacity: 1;
}
.sidebar-bottom {
  margin: auto 24px 24px;
  font-size: 12px;
  color: #6f7d72;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.sidebar-bottom div {
  margin: 8px 0 0 15px;
  font-size: 11px;
  color: #9ca59e;
}
.environment-dot,
.shop-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #87a070;
  border-radius: 50%;
  margin-right: 8px;
}
.workspace-topbar {
  height: 76px;
  position: fixed;
  left: 224px;
  right: 0;
  top: 0;
  background: #ffffffee;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.breadcrumb {
  font-size: 13px;
  color: #8d9790;
  display: flex;
  align-items: center;
  gap: 15px;
}
.breadcrumb strong {
  color: #4b5a50;
  font-weight: 500;
}
.breadcrumb span {
  color: #d0d7d2;
}
#session {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.operator {
  padding: 4px 10px;
  background: #f1f4f2;
  border-radius: 4px;
  color: #818c84;
  font-size: 11px;
  margin-left: 8px;
}
#logout {
  font-size: 12px;
  padding: 6px 10px;
  border: 0;
}
.workspace-main {
  margin-left: 224px;
  padding: 100px 32px 26px;
  min-height: 100vh;
}
.workspace-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #97a098;
  font-size: 12px;
  margin-bottom: 22px;
}
.workspace-meta > div {
  display: flex;
  align-items: center;
  gap: 15px;
}
.refresh-button {
  font-size: 12px;
  padding: 6px 10px;
}
.workspace-footer {
  font-size: 11px;
  text-align: center;
  color: #a2aba5;
  margin-top: 32px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}
.page-head h2 {
  margin-bottom: 8px;
}
.page-head p {
  margin: 0;
  color: #88938b;
}
.page-head .head-actions {
  display: flex;
  gap: 10px;
}
.panel,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 23px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 10px 0;
}
.cards .card .row:first-child {
  margin-top: 0;
}
.status {
  font-size: 15px;
  color: #44694c;
  font-weight: 600;
}
.total {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.badge {
  font-size: 11px;
  border-radius: 5px;
  background: #f0f4f0;
  color: #6d826f;
  padding: 5px 9px;
  white-space: nowrap;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.actions button {
  padding: 7px 11px;
  font-size: 12px;
}
.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.stats span {
  background: #fff;
  border: 1px solid var(--line);
  padding: 13px 20px;
  border-radius: 7px;
  font-size: 13px;
  color: #6f7d73;
}
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 17px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  flex-wrap: wrap;
}
.filter-bar input {
  max-width: 320px;
}
.filter-bar select {
  width: 160px;
}
.filter-count {
  margin-left: auto;
  color: #9aa39d;
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  text-align: left;
}
th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid #eef1ef;
  font-size: 13px;
  vertical-align: middle;
}
th {
  background: #fafbfa;
  color: #8c968e;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fcfdfc;
}
td input {
  max-width: 110px;
}
td select {
  min-width: 90px;
}
td button {
  font-size: 12px;
  padding: 6px 12px;
}
.table-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.table-product img {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  background: #f4f6f3;
}
.table-product strong {
  font-size: 13px;
  font-weight: 550;
}
.table-product .muted {
  font-size: 11px;
  margin-top: 4px;
}
.state-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 4px;
  display: inline-block;
  background: #edf5ef;
  color: #50815b;
}
.state-pill.off {
  background: #f1f2f3;
  color: #969b98;
}
.pagination {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 14px 18px;
  border-radius: 0 0 9px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #8c978f;
}
.pagination .pager-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pagination button {
  padding: 5px 10px;
  font-size: 12px;
}
.empty {
  padding: 65px 20px;
  text-align: center;
  color: #99a39b;
  font-size: 13px;
  background: #fff;
  border: 1px dashed #dbe3dc;
  border-radius: 8px;
}
li {
  font-size: 13px;
  line-height: 1.9;
}
ul {
  padding-left: 18px;
  margin: 18px 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
.segmented {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.segmented button {
  background: none;
  color: #8a968c;
  border-radius: 0;
  padding: 12px 18px;
  border-bottom: 2px solid transparent;
}
.segmented button.active {
  color: #365b3d;
  border-bottom-color: #527e59;
}
.product-dialog,
.ui-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(760px, calc(100vw - 40px));
  max-height: 88vh;
  padding: 28px 30px;
  color: #26342c;
  background: #fff;
  box-shadow: 0 25px 100px #172b2233;
}
.product-dialog::backdrop,
.ui-dialog::backdrop {
  background: #172b2260;
  backdrop-filter: blur(2px);
}
.product-dialog h2,
.ui-dialog h2 {
  font-size: 20px;
}
.product-dialog .cards {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0 20px;
}
.ui-dialog form > .cards {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 12px;
}
.dialog-header h2 {
  margin: 0;
}
.dialog-close {
  background: transparent;
  color: #879188;
  padding: 4px 9px;
  font-size: 23px;
  font-weight: 400;
}
.dialog-message,
#edit-error {
  font-size: 13px;
  line-height: 1.6;
  color: #b66c4c;
  margin-top: 12px;
}
.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.section-title {
  font-size: 16px;
  margin: 26px 0 16px;
}
.rules-layout {
  max-width: 860px;
}
.rules-layout form {
  padding: 26px;
}
.rules-layout label {
  max-width: 650px;
}
#notice {
  position: fixed;
  top: 85px;
  left: calc(50% + 80px);
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #dae4db;
  box-shadow: 0 4px 18px #152c1810;
  border-radius: 7px;
  padding: 12px 22px;
  color: #45654c;
  z-index: 90;
  font-size: 13px;
  max-width: 85vw;
}
#notice:empty {
  display: none;
}
#login {
  width: min(430px, calc(100vw - 40px));
  margin: 12vh auto 0;
  padding: 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 80px #25392908;
}
#login h1 {
  font-size: 23px;
  margin: 22px 0 9px;
}
.login-mark {
  width: 46px;
  height: 46px;
  font-size: 26px;
}
.login-note {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
  font-size: 11px;
  color: #a3aba5;
}
#login button {
  width: 100%;
  margin-top: 12px;
}
.login-note + p {
  display: none;
}
body:not(.authenticated) #notice {
  left: 50%;
}
details summary {
  cursor: pointer;
}
#content > h2 {
  margin: 20px 0;
}
#content > h3 {
  margin-top: 28px;
}
#content > div[style*="overflow"] {
  border: 1px solid var(--line);
  border-radius: 8px;
}
#content > .cards:has(article > h2) {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin: 22px 0;
}
#content > .cards article > h2 {
  font-size: 25px;
  margin-top: 12px;
}
.cards form.card > h3 {
  margin-top: 0;
}
@media (min-width: 1650px) {
  .workspace-main {
    padding-left: 48px;
    padding-right: 48px;
  }
  .cards {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
  }
}
@media (max-width: 1000px) {
  .sidebar {
    width: 184px;
  }
  .brand {
    padding: 25px 16px;
    gap: 9px;
  }
  .brand strong {
    font-size: 14px;
  }
  .workspace-topbar {
    left: 184px;
    padding: 0 20px;
  }
  .workspace-main {
    margin-left: 184px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .operator {
    display: none;
  }
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  }
}
@media (max-width: 700px) {
  .sidebar {
    width: 68px;
  }
  .brand {
    padding: 22px 14px;
  }
  .brand > div,
  .nav-label,
  .sidebar-bottom,
  nav .nav-arrow {
    display: none;
  }
  nav {
    padding: 0 8px;
  }
  nav button {
    font-size: 0;
    justify-content: center;
    padding: 13px 5px;
  }
  nav .nav-icon {
    font-size: 22px;
  }
  .workspace-topbar {
    left: 68px;
    height: 65px;
    padding: 0 14px;
  }
  .breadcrumb {
    font-size: 12px;
    gap: 7px;
  }
  .breadcrumb > span,
  .breadcrumb {
    color: #8d9790;
  }
  #session > span {
    display: none;
  }
  .workspace-main {
    margin-left: 68px;
    padding: 86px 14px 20px;
  }
  .workspace-meta > span {
    display: none;
  }
  .workspace-meta {
    justify-content: flex-end;
  }
  #updated {
    font-size: 10px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .filter-bar input {
    max-width: none;
  }
  .filter-bar select {
    width: 100%;
  }
  .filter-count {
    margin-left: 0;
  }
  .form-columns,
  .ui-dialog form > .cards,
  .product-dialog .cards {
    grid-template-columns: 1fr;
  }
  .product-dialog,
  .ui-dialog {
    padding: 20px;
  }
  #content > .cards:has(article > h2) {
    grid-template-columns: repeat(2, minmax(95px, 1fr));
  }
  #notice {
    left: 50%;
  }
}
.product-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 7px;
  background: #f1f5ef;
  color: #92a38c;
  font-size: 18px;
}
.card form {
  margin: 0;
}
.ui-dialog > form {
  padding: 0;
}
.ui-dialog .dialog-close:hover {
  background: #f3f5f3;
  color: #49614e;
}
.ui-dialog .reward-form,
.ui-dialog #new-campaign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.ui-dialog .reward-form > button,
.ui-dialog #new-campaign > button,
.ui-dialog .reward-form > h3,
.ui-dialog #new-campaign > h3,
.ui-dialog label:has([name="title"]) {
  grid-column: 1 / -1;
}
.ui-dialog form > button {
  margin-top: 14px;
}
.dialog-header {
  position: sticky;
  top: -28px;
  background: #fff;
  z-index: 1;
  padding-top: 8px;
}
#edit-product > .row {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
@media (max-width: 700px) {
  .ui-dialog .reward-form,
  .ui-dialog #new-campaign {
    grid-template-columns: 1fr;
  }
}
.nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}
.store-settings {
  grid-column: 1 / -1;
}
.store-settings > label:not([hidden]) {
  display: inline-block;
  min-width: 220px;
  max-width: 320px;
  margin-right: 24px;
  vertical-align: top;
}
.settings-section {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 24px;
}
.week-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f3f1;
}
.week-row > strong {
  font-size: 13px;
  font-weight: 500;
  width: 34px;
  flex-shrink: 0;
}
.full-day {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 400;
  font-size: 12px;
  white-space: nowrap;
}
.full-day input {
  width: 14px;
  margin: 0;
  accent-color: var(--green);
}
.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.time-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8d988f;
}
.time-slot input {
  width: 114px;
  padding: 7px;
  font-size: 12px;
}
.time-slot button,
.week-row > .add-time {
  padding: 6px 10px;
  font-size: 12px;
}
.settings-section td input {
  max-width: none;
  min-width: 90px;
}
.settings-section td:first-child input {
  min-width: 150px;
}
.settings-section .table-wrap {
  border-radius: 8px;
}
.settings-section .row p {
  margin-bottom: 0;
}
.settings-section h3 {
  margin-bottom: 8px;
}
@media (max-width: 700px) {
  .week-row {
    flex-wrap: wrap;
    gap: 12px;
  }
  .time-slots {
    flex-basis: 100%;
    order: 3;
  }
  .time-slot input {
    width: 95px;
  }
  .settings-section > .row {
    flex-wrap: wrap;
  }
}

/* Compact work areas: filters and actions sit directly above their data. */
.list-actions { display:flex; align-items:center; gap:10px; margin-left:auto; }
.filter-bar { flex-wrap:wrap; }
.filter-bar .filter-count { margin-left:0; }
.marketing-filter { margin-bottom:12px; border-radius:10px; }
.standalone-toolbar { justify-content:flex-end; margin-bottom:16px; border-radius:10px; }
#content > .row:empty { display:none; }
@media(max-width:700px) { .list-actions { flex-wrap:wrap; } .filter-bar input[type=search] { max-width:none; flex:1 1 200px; } }
