:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #243d36;
  background: #f5f6f3;
  font-synthesis: none;
  --green: #214c42;
  --accent: #d7e5bd;
  --muted: #76817a;
  --line: #e5e9e2;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 16px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
  padding: 0.75rem 1rem;
  border-radius: 9px;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  transition: background 0.15s;
}
button:hover,
.button:hover {
  background: #f1f5ed;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #90ae70;
  outline-offset: 3px;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #173b32;
}
.secondary {
  background: white;
  border-color: #d8dfd3;
}
.light {
  background: #ffffff15;
  color: white;
  border-color: #ffffff40;
}
.light:hover {
  background: #ffffff25;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 0.5rem;
  color: var(--green);
}
.compact {
  padding: 0.45rem 0.8rem;
  font-size: 0.875rem;
}
.danger {
  color: #a64435;
}
.sidebar {
  width: 246px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 34px 19px 22px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  color: var(--green);
  padding: 0 10px 37px;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.brand-mark {
  background: var(--green);
  color: var(--accent);
  width: 41px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}
.brand-mark .icon {
  width: 27px;
  height: 27px;
}
.brand small {
  font-size: 0.6rem;
  display: block;
  letter-spacing: 1.1px;
  font-weight: 600;
  margin-top: 5px;
  white-space: nowrap;
}
.nav-label {
  font-size: 0.65rem;
  color: #89938a;
  letter-spacing: 1.4px;
  margin: 8px 13px 19px;
  font-weight: 650;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 8px;
  padding: 13px 14px;
  margin-bottom: 5px;
  text-decoration: none;
  color: #6b766e;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-item.active {
  color: var(--green);
  background: #edf2e7;
  font-weight: 650;
}
.nav-item:hover {
  background: #f5f7f2;
}
.nav-count {
  margin-left: auto;
  background: white;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
}
.sidebar-bottom {
  margin-top: auto;
}
.offline-card {
  border: 1px solid var(--line);
  background: #fafbf7;
  padding: 15px 10px;
  border-radius: 10px;
  display: flex;
  gap: 7px;
  font-size: 0.72rem;
  line-height: 1.5;
}
.offline-card .icon {
  width: 16px;
}
.offline-card small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}
.profile {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 22px 7px 0;
  margin-top: 22px;
  font-size: 0.88rem;
  font-weight: 600;
}
.profile small {
  display: block;
  font-size: 0.69rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.avatar {
  background: #f3e8df;
  color: #916342;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
}
.avatar.small {
  width: 31px;
  height: 31px;
  font-size: 0.67rem;
  background: #edf1e8;
  color: #657b59;
}
.main-shell {
  margin-left: 246px;
}
.topbar {
  height: 77px;
  border-bottom: 1px solid var(--line);
  background: #ffffffa0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}
.breadcrumb {
  font-size: 0.82rem;
  color: #67746a;
}
.breadcrumb span {
  margin: 0 13px;
  color: #c4cbc0;
}
.sync-status {
  font-weight: 400;
  background: transparent;
  border: 0;
  color: #607663;
  font-size: 0.76rem;
  padding: 7px;
}
.sync-status .icon {
  width: 17px;
}
.sync-status.offline {
  color: #a07436;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 36px 40px 25px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 29px;
}
.eyebrow {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 1.6px;
  color: #7d8c78;
  margin-bottom: 11px;
}
h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}
.hello {
  font-size: 1.9rem;
  color: #b1c68b;
  display: inline-block;
  margin-left: 7px;
}
.page-heading p {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  font-weight: 600;
}
p {
  line-height: 1.6;
}
a {
  color: var(--green);
}
.cycle-banner {
  background: var(--green);
  border-radius: 13px;
  color: white;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
}
.cycle-banner:after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid #ffffff10;
  border-radius: 50%;
  right: 90px;
  pointer-events: none;
}
.cycle-banner > div {
  display: flex;
  align-items: center;
  gap: 21px;
  flex: 1;
}
.banner-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: #ffffff10;
  border: 1px solid #ffffff12;
  border-radius: 50%;
  color: #cfdfb2;
}
.banner-icon .icon {
  width: 27px;
  height: 27px;
}
.cycle-banner .eyebrow {
  color: #bfceb5;
  font-size: 0.6rem;
  margin: 0 0 7px;
}
.cycle-banner h2 {
  font-size: 1.65rem;
  letter-spacing: -0.5px;
}
.cycle-banner h2 span {
  color: #b7c6b8;
  font-weight: 400;
}
.cycle-banner p {
  font-size: 0.77rem;
  margin: 7px 0 0;
  color: #c0d0c5;
}
.cycle-banner .badge {
  background: #d2e4b923;
  color: #d4e5ba;
}
.badge {
  font-size: 0.72rem;
  display: inline-flex;
  white-space: nowrap;
  border-radius: 6px;
  padding: 5px 9px;
  font-weight: 500;
  line-height: 1.3;
}
.green {
  background: #edf3e5;
  color: #5e7940;
}
.amber {
  background: #fbefdb;
  color: #a07735;
}
.neutral,
.badge:not(.green):not(.amber) {
  background: #f1f2ed;
  color: #7a8073;
}
.cycle-banner .badge.green {
  background: #d2e4b923;
  color: #d4e5ba;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 16px;
}
.section-label > span {
  font-size: 0.72rem;
  color: #8c958c;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}
.stat {
  border: 1px solid var(--line);
  background: white;
  padding: 20px 20px 19px;
  border-radius: 11px;
  min-width: 0;
}
.stat-label {
  font-size: 0.79rem;
  color: #7d877d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-label .icon {
  width: 18px;
  height: 18px;
  color: #8e9a89;
}
.stat strong {
  font-size: 1.65rem;
  letter-spacing: -0.7px;
  display: block;
  margin: 15px 0 9px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.stat small {
  font-size: 0.7rem;
  color: #91998d;
}
.stat.profit {
  background: #eef3e6;
  border-color: #e1e9d6;
}
.stat.profit strong {
  color: #55723d;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 22px 0;
  margin: 0 0 8px;
}
.mini-stats > div {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-right: 1px solid #dce3d6;
}
.mini-stats > div:last-child {
  border: 0;
}
.mini-stats .icon {
  width: 17px;
  height: 17px;
  color: #8a9a7d;
}
.mini-stats strong {
  font-size: 1.05rem;
  color: #4b6145;
}
.mini-stats span {
  color: #89917f;
  font-size: 0.7rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 22px;
  margin-top: 12px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.panel-heading {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.panel-heading a {
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 500;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
}
th {
  font-size: 0.68rem;
  font-weight: 500;
  color: #9aa294;
  background: #fcfdf9;
  border-top: 1px solid #f3f4ee;
  border-bottom: 1px solid #f0f2e9;
  padding: 13px 22px;
}
td {
  padding: 17px 22px;
  border-bottom: 1px solid #f0f2eb;
  color: #6c7668;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td strong {
  font-weight: 550;
  color: #43573e;
}
.person {
  display: flex;
  gap: 10px;
  align-items: center;
}
.block {
  display: block;
  color: #939b8e;
  font-size: 0.69rem;
  margin-top: 5px;
}
.shortcuts .panel-heading {
  padding-bottom: 9px;
}
.shortcut {
  display: flex;
  text-align: left;
  justify-content: start;
  border: 0;
  width: 100%;
  padding: 15px 22px;
  background: transparent;
  gap: 12px;
  border-radius: 0;
  font-size: 0.81rem;
  font-weight: 500;
}
.shortcut strong {
  font-size: 0.82rem;
  font-weight: 550;
  display: block;
}
.shortcut small {
  font-size: 0.7rem;
  font-weight: 400;
  display: block;
  color: #969d8f;
  margin-top: 5px;
}
.shortcut-icon {
  background: #f4f6ed;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #758b60;
}
.shortcut-icon .icon {
  width: 18px;
}
.gift-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #e3e8d6;
  background: #f0f3e8;
  padding: 21px 25px;
  margin-top: 24px;
  border-radius: 10px;
}
.gift-strip > .icon {
  width: 31px;
  height: 31px;
  color: #7f9566;
}
.gift-strip > div {
  flex: 1;
}
.gift-strip h3 {
  font-size: 0.88rem;
  color: #62784f;
  font-weight: 550;
}
.gift-strip p {
  font-size: 0.74rem;
  color: #8d997e;
  margin: 0;
}
.gift-strip .button {
  font-size: 0.75rem;
  background: #ffffff70;
}
footer {
  padding: 14px 40px 25px;
  color: #a0a89a;
  font-size: 0.67rem;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.toolbar > span {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: auto;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 13px;
  min-width: 260px;
  flex: 1;
  max-width: 460px;
  color: #8c9a84;
}
.search input {
  border: 0;
  background: transparent;
  padding: 12px 0;
  outline: 0;
  min-width: 0;
}
.search .icon {
  width: 18px;
}
input,
select,
textarea {
  border: 1px solid #dce3d6;
  background: white;
  color: #344b3d;
  padding: 11px 12px;
  border-radius: 7px;
  width: 100%;
  font-size: 0.9rem;
  min-height: 44px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #a5bc8e;
  outline-offset: 1px;
}
input::placeholder {
  color: #a0a69c;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%2376817a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
}
.toolbar > select {
  width: auto;
}
.cycle-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.cycle-picker select {
  width: auto;
}
.empty {
  text-align: center;
  padding: 42px 25px;
  color: var(--muted);
  width: 100%;
}
.empty > .icon {
  color: #a3b68c;
  background: #f2f5eb;
  width: 49px;
  height: 49px;
  border-radius: 15px;
  padding: 12px;
  margin-bottom: 15px;
}
.empty h3 {
  color: #506747;
  font-size: 1rem;
}
.empty p {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 8px auto 20px;
}
.hint {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #8a9583;
}
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}
.cycle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cycle-card {
  padding: 0 22px 20px;
}
.cycle-card .panel-heading {
  padding: 23px 0 10px;
}
.cycle-card h2 {
  font-size: 1.25rem;
}
.cycle-card h2 span {
  color: #a2ac9b;
  font-size: 0.95rem;
  font-weight: 400;
}
.cycle-card p {
  font-size: 0.8rem;
  color: var(--muted);
}
.cycle-numbers {
  display: flex;
  gap: 35px;
  margin: 25px 0;
}
.cycle-numbers small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.cycle-numbers strong {
  display: block;
  margin-top: 8px;
  font-weight: 550;
  font-size: 1.3rem;
}
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 23px;
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.gift-art {
  height: 150px;
  background: #eef1e6;
  display: grid;
  place-items: center;
  color: #8da16f;
}
.gift-art > .icon {
  width: 45px;
  height: 45px;
}
.gift-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gift-content {
  padding: 20px;
}
.gift-content > small {
  font-size: 0.7rem;
  color: #97a08d;
}
.gift-content h3 {
  margin-top: 7px;
}
.gift-content p {
  font-size: 0.8rem;
  color: var(--muted);
}
.gift-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sales-panel {
  margin-top: 30px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.settings-card {
  padding: 25px;
}
.settings-card p,
.settings-card ol {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.8;
}
.settings-card > button {
  margin: 0 7px 10px 0;
}
.setting-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #edf3e5;
  margin-bottom: 17px;
}
.notice {
  background: #f1f5ec;
  padding: 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.notice small {
  display: block;
  font-size: 0.75rem;
  margin-top: 7px;
}
.summary {
  margin: 20px 0;
}
.summary > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 0.88rem;
}
.summary dt {
  color: var(--muted);
}
.summary dd {
  font-weight: 600;
  margin: 0;
  text-align: right;
}
.summary > div:last-child {
  border-bottom: 0;
  color: var(--green);
}
dialog {
  border: 0;
  border-radius: 14px;
  width: min(760px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 0;
  box-shadow: 0 30px 100px #173b3230;
  color: #344b3d;
  background: #fff;
}
dialog::backdrop {
  background: #153b3255;
  backdrop-filter: blur(3px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 20px 25px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
.modal-heading h2 {
  font-size: 1.25rem;
}
.close-button {
  font-size: 1.5rem;
  padding: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  font-weight: 400;
}
.modal-body {
  padding: 25px;
}
.modal-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 25px;
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 2;
}
.modal-body label {
  display: block;
  font-size: 0.8rem;
  color: #6f7b67;
  margin-bottom: 17px;
}
.modal-body input,
.modal-body select,
.modal-body textarea {
  display: block;
  margin-top: 8px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.optional {
  color: #9aa48f;
  font-weight: 400;
}
.checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.checkbox input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.inline-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 18px;
  font-size: 0.8rem;
  color: #87957c;
}
.line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
}
.line-head h3 {
  margin: 0;
}
.product-line {
  background: #f8f9f5;
  border: 1px solid #e8ecdf;
  border-radius: 9px;
  padding: 16px;
  margin: 12px 0;
}
.line-top {
  display: grid;
  grid-template-columns: 2fr 1fr 25px;
  gap: 12px;
  align-items: start;
}
.line-bottom {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}
.product-line label {
  margin-bottom: 10px;
}
.remove-line {
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: 26px;
  font-size: 1.4rem;
  color: #a09e90;
  min-height: 30px;
}
.line-subtotal small {
  display: block;
  color: #939c88;
  font-size: 0.72rem;
}
.line-subtotal strong {
  font-size: 0.9rem;
  display: block;
  margin-top: 12px;
  font-weight: 550;
}
.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #edf3e5;
  border-radius: 8px;
  margin: 18px 0 23px;
  font-size: 0.85rem;
}
.order-summary strong {
  margin-left: 8px;
  font-size: 1.1rem;
}
.order-summary > span:last-child {
  font-size: 0.8rem;
}
.detail-intro {
  margin-bottom: 20px;
}
.detail-intro h3 {
  font-size: 1.3rem;
}
.detail-intro p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0;
}
.detail-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.history-row,
.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 0.85rem;
  gap: 12px;
}
.history-row small {
  display: block;
  color: #949e8a;
  margin-top: 7px;
  font-size: 0.75rem;
}
.payment-row strong {
  display: block;
  margin-top: 5px;
}
.modal-body > h3 {
  margin-top: 25px;
}
#form-error {
  margin: 0 25px 15px;
  color: #a64435;
  font-size: 0.85rem;
  line-height: 1.6;
}
#form-error:empty {
  display: none;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: calc(50% + 100px);
  transform: translateX(-50%) translateY(120px);
  background: #214c42;
  color: white;
  border-radius: 10px;
  padding: 15px 22px;
  max-width: calc(100% - 40px);
  z-index: 99;
  opacity: 0;
  transition: 0.25s;
  font-size: 0.875rem;
  box-shadow: 0 8px 30px #173b3230;
  pointer-events: none;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.mobile-nav {
  display: none;
}
.boot {
  margin: 10vh auto;
  text-align: center;
}
@media (min-width: 1500px) {
  main {
    padding-top: 45px;
  }
  .stat strong {
    font-size: 1.9rem;
  }
  .mini-stats span {
    font-size: 0.78rem;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 215px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .main-shell {
    margin-left: 215px;
  }
  .brand {
    font-size: 1.3rem;
  }
  .brand small {
    font-size: 0.54rem;
  }
  main {
    padding: 28px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 17px 14px;
  }
  .stat strong {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }
  .dashboard-grid {
    grid-template-columns: 1.6fr 1fr;
    gap: 15px;
  }
  td,
  th {
    padding-left: 15px;
    padding-right: 15px;
  }
  .mini-stats > div {
    gap: 5px;
  }
  .mini-stats span {
    font-size: 0.65rem;
  }
  .gift-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  footer {
    padding-left: 25px;
    padding-right: 25px;
  }
}
@media (max-width: 900px) {
  .sidebar {
    width: 185px;
  }
  .main-shell {
    margin-left: 185px;
  }
  .brand {
    padding: 0 3px 30px;
    font-size: 1.15rem;
    gap: 7px;
  }
  .brand-mark {
    width: 34px;
    height: 38px;
  }
  .brand small {
    font-size: 0.46rem;
  }
  .nav-item {
    font-size: 0.82rem;
    padding: 12px 9px;
    gap: 10px;
  }
  .nav-label {
    font-size: 0.57rem;
    margin-left: 8px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .stat strong {
    font-size: 1.75rem;
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
  }
  .mini-stats > div {
    justify-content: start;
    border: 0;
  }
  .mini-stats span {
    font-size: 0.73rem;
  }
  .shortcuts {
    display: none;
  }
  .page-heading {
    align-items: start;
  }
  .page-heading > .primary {
    font-size: 0.8rem;
    white-space: nowrap;
  }
  h1 {
    font-size: 1.8rem;
  }
  .eyebrow {
    font-size: 0.59rem;
  }
  .page-heading p {
    font-size: 0.8rem;
  }
  .cycle-banner {
    padding: 22px;
    flex-wrap: wrap;
  }
  .cycle-banner > div {
    min-width: 100%;
    gap: 15px;
  }
  .cycle-banner .badge {
    margin-left: 73px;
  }
  .cycle-banner .light {
    margin-left: auto;
    font-size: 0.8rem;
  }
  .settings-grid,
  .cycle-grid {
    grid-template-columns: 1fr;
  }
  .stats.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats.three .stat strong {
    font-size: 1.2rem;
  }
  .gift-strip {
    padding: 20px;
    flex-wrap: wrap;
  }
  .gift-strip .button {
    margin-left: 48px;
  }
  .sync-status {
    font-size: 0.66rem;
  }
  .topbar {
    height: 65px;
  }
  .breadcrumb {
    font-size: 0.73rem;
  }
  footer span {
    display: none;
  }
  .offline-card {
    font-size: 0.65rem;
  }
  .profile {
    font-size: 0.75rem;
  }
  #toast {
    left: calc(50% + 80px);
  }
}
@media (max-width: 650px) {
  .sidebar {
    display: none;
  }
  .main-shell {
    margin-left: 0;
  }
  .topbar {
    padding: 0 20px;
    height: 57px;
  }
  .breadcrumb {
    font-size: 0.7rem;
  }
  .breadcrumb span {
    margin: 0 7px;
  }
  .sync-status {
    font-size: 0.64rem;
    max-width: 190px;
    text-align: right;
    gap: 5px;
  }
  .sync-status .icon {
    width: 15px;
  }
  main {
    padding: 25px 20px 15px;
  }
  .page-heading {
    flex-wrap: wrap;
    gap: 19px;
    margin-bottom: 22px;
  }
  .page-heading > div {
    width: 100%;
  }
  .page-heading > .primary {
    width: 100%;
    font-size: 0.9rem;
    padding: 12px;
  }
  .eyebrow {
    font-size: 0.57rem;
    letter-spacing: 1.4px;
  }
  h1 {
    font-size: 1.9rem;
  }
  .page-heading p {
    font-size: 0.83rem;
  }
  .cycle-banner {
    padding: 20px;
    gap: 16px;
  }
  .banner-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
  }
  .cycle-banner h2 {
    font-size: 1.45rem;
  }
  .cycle-banner p {
    font-size: 0.7rem;
  }
  .cycle-banner .badge {
    margin-left: 60px;
  }
  .section-label {
    margin: 25px 0 15px;
  }
  .section-label h2 {
    font-size: 0.95rem;
  }
  .section-label > span {
    display: none;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 17px 14px;
  }
  .stat-label {
    font-size: 0.73rem;
    gap: 4px;
  }
  .stat-label .icon {
    width: 15px;
  }
  .stat strong {
    font-size: 1.4rem;
    margin: 15px 0 9px;
  }
  .stat small {
    font-size: 0.65rem;
    line-height: 1.5;
    display: block;
  }
  .mini-stats {
    padding: 22px 2px;
    gap: 18px 5px;
    margin-bottom: 0;
  }
  .mini-stats span {
    font-size: 0.65rem;
  }
  .mini-stats strong {
    font-size: 0.9rem;
  }
  .mini-stats .icon {
    width: 15px;
  }
  .panel-heading {
    padding: 20px 17px;
  }
  .panel-heading h2 {
    font-size: 0.98rem;
  }
  .dashboard-grid {
    margin-top: 8px;
  }
  .gift-strip {
    margin-top: 20px;
    padding: 18px 16px;
    gap: 13px;
  }
  .gift-strip h3 {
    font-size: 0.8rem;
  }
  .gift-strip p {
    font-size: 0.7rem;
  }
  .gift-strip .button {
    margin-left: 44px;
  }
  .gift-strip > .icon {
    width: 30px;
  }
  footer {
    padding: 10px 20px 95px;
    font-size: 0.63rem;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--line);
    padding: 11px 6px calc(9px + env(safe-area-inset-bottom));
    z-index: 15;
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 56px;
    text-decoration: none;
    color: #8d9885;
    font-size: 0.62rem;
  }
  .mobile-nav a.active {
    color: var(--green);
    font-weight: 650;
  }
  .mobile-nav a.active .icon {
    background: #edf3e5;
    box-shadow: 0 0 0 7px #edf3e5;
    border-radius: 3px;
  }
  .mobile-nav .icon {
    width: 20px;
    height: 20px;
  }
  .toolbar {
    gap: 12px;
  }
  .search {
    min-width: 100%;
    max-width: none;
  }
  .toolbar .cycle-picker {
    flex: 1;
  }
  .toolbar > span {
    font-size: 0.7rem;
  }
  .cycle-picker {
    font-size: 0.75rem;
  }
  .cycle-picker select {
    font-size: 0.8rem;
  }
  .toolbar > select {
    font-size: 0.8rem;
    flex: 1;
    min-width: 100px;
  }
  table {
    font-size: 0.78rem;
  }
  th {
    font-size: 0.67rem;
  }
  td,
  th {
    padding: 14px;
  }
  .empty {
    padding: 32px 20px;
  }
  .empty p {
    font-size: 0.8rem;
  }
  .stats.three {
    grid-template-columns: 1fr;
  }
  .stats.three .stat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 5px 10px;
  }
  .stats.three .stat strong {
    margin: 0;
    text-align: right;
    font-size: 1.4rem;
  }
  .stats.three .stat small {
    grid-column: 1/-1;
  }
  .gift-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .gift-art {
    height: 110px;
  }
  .gift-content {
    padding: 13px;
  }
  .gift-content h3 {
    font-size: 0.86rem;
  }
  .gift-content p {
    font-size: 0.72rem;
  }
  .gift-card-bottom {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
  .gift-card-bottom .badge {
    font-size: 0.65rem;
  }
  .sales-panel {
    margin-top: 22px;
  }
  .settings-card {
    padding: 20px;
  }
  .settings-card h2 {
    font-size: 1rem;
  }
  .settings-card p {
    font-size: 0.8rem;
  }
  .settings-card > button {
    font-size: 0.8rem;
  }
  .cycle-numbers strong {
    font-size: 1.15rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .modal-body {
    padding: 20px;
  }
  .modal-heading {
    padding: 17px 20px;
  }
  .modal-heading h2 {
    font-size: 1.1rem;
  }
  .modal-footer {
    padding: 15px 20px;
  }
  .modal-footer button {
    font-size: 0.85rem;
  }
  .line-top {
    grid-template-columns: 1fr 27px;
    gap: 0 10px;
  }
  .line-top > label:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .line-top > label:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .line-top > .remove-line {
    grid-column: 2;
    grid-row: 1;
    margin-top: 24px;
  }
  .line-bottom {
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }
  .product-line {
    padding: 13px;
  }
  .line-subtotal {
    padding-bottom: 10px;
  }
  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 16px;
  }
  .line-head h3 {
    font-size: 0.9rem;
  }
  .line-head button {
    font-size: 0.78rem;
  }
  .detail-actions button {
    font-size: 0.8rem;
  }
  .summary > div {
    font-size: 0.8rem;
  }
  .order-summary {
    font-size: 0.8rem;
  }
  #toast {
    bottom: calc(90px + env(safe-area-inset-bottom));
    left: 50%;
    font-size: 0.8rem;
    width: max-content;
    max-width: calc(100% - 30px);
  }
  dialog {
    max-height: 92dvh;
    width: calc(100% - 20px);
  }
  .detail-intro h3 {
    font-size: 1.1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.module-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.module-links a {
  font-size: 0.85rem;
}
.stat-label,
.modal-body label,
table,
.nav-item {
  font-size: 0.875rem;
}
.settings-card p,
.settings-card ol,
.shortcut strong,
.gift-content p,
.empty p {
  font-size: 0.875rem;
}
.page-heading p {
  font-size: 0.9375rem;
}
