:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #142b28;
  background: #f3f5f3;
  --ink: #142b28;
  --muted: #526a63;
  --soft: #687e76;
  --line: #dce5e1;
  --panel: #fff;
  --bg: #f3f5f3;
  --brand: #087b68;
  --brand-dark: #056051;
  --pale: #e6f4ee;
  --green: #176b53;
  --red: #a63c47;
  --radius: 12px;
  --rail: #132e28;
  --rail-line: #345148;
  --shell-gutter: clamp(18px, 2.5vw, 36px);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
a { color: var(--brand-dark); text-decoration: none; }
:focus-visible { outline: 2px solid #19a383; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.boot, .brand { display: flex; align-items: center; gap: 10px; }
.boot { min-height: 100vh; justify-content: center; font-size: 20px; }
.brand { width: max-content; color: inherit; font-size: 20px; font-weight: 760; letter-spacing: -.045em; }
.brand-icon {
  width: 32px; height: 32px; position: relative; flex: none; border-radius: 9px;
  background: #9de4c3; color: #123b30;
}
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; width: 5px; border-radius: 2px; background: currentColor; transform: skewY(-22deg); }
.brand-icon::before { height: 15px; top: 8px; left: 9px; }
.brand-icon::after { height: 12px; top: 10px; right: 9px; }
.icon { flex: none; display: block; width: 18px; height: 18px; }
.app-shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  --icon-fill: var(--rail); position: sticky; inset-block-start: 0; height: 100dvh; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; padding: 22px 14px 14px; z-index: 11; background: var(--rail); color: #f1f7f2;
}
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding-inline: 8px; margin-bottom: 27px; }
.btn.sidebar-dismiss, .nav-backdrop, .btn.menu-toggle { display: none; }
.shop-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 15px; align-items: center; gap: 10px;
  padding: 9px; margin: 0 0 27px; border: 1px solid var(--rail-line); border-radius: 10px;
  background: #1b3a32; color: #f4f8f4;
}
.shop-card:hover { background: #274b40; }
.shop-card > .icon { width: 14px; height: 14px; opacity: .62; }
.shop-avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  background: #c6e8d7; color: #19453a; font-weight: 750; font-size: 14px;
}
.shop-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 700; }
.shop-caption, .account-email { display: block; margin-top: 3px; color: #afc5bd; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-heading { margin: 0 10px 7px; color: #a3b9af; font-size: 11px; line-height: 1.4; letter-spacing: .045em; }
.nav-group { display: grid; gap: 4px; margin-bottom: 25px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 8px 10px;
  border-radius: 8px; color: #d5e3dc; font-size: 13px; font-weight: 590; transition: background .16s, color .16s;
}
.nav-item:hover { background: #224337; color: #fff; }
.nav-item.active { --icon-fill: #285044; color: #dbfae6; background: #285044; font-weight: 720; }
.nav-item.active .icon { color: #9ae4c0; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--rail-line); padding-top: 12px; }
.account { display: grid; grid-template-columns: 32px minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding-inline: 3px; }
.account .shop-avatar { width: 32px; height: 32px; border-radius: 50%; background: #37584b; color: #e2f2e8; }
.sidebar .btn.flat { background: transparent; color: #cfe0d6; }
.sidebar .btn.flat:hover { color: #fff; background: #2b4c40; }

.main-wrap { min-width: 0; }
.topbar {
  position: sticky; inset-block-start: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 15px;
  min-height: 62px; padding-inline: var(--shell-gutter); background: #fff; border-bottom: 1px solid var(--line);
}
.crumbs, .top-actions { display: flex; gap: 11px; align-items: center; min-width: 0; white-space: nowrap; }
.crumbs { color: var(--muted); font-size: 12px; }
.crumbs .icon { width: 13px; height: 13px; }
.crumbs .menu-toggle .icon { width: 21px; height: 21px; }
.crumbs strong { color: var(--ink); font-weight: 650; }
.workspace-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #deece2;
  border-radius: 7px; white-space: nowrap; background: #eff7f1; color: #2d6250; font-size: 11px; font-weight: 640;
}
.workspace-badge i { width: 6px; height: 6px; border-radius: 50%; background: #418464; }
.btn.jump-trigger { gap: 8px; padding: 6px 8px 6px 9px; color: var(--muted); background: #f7f9f7; }
.jump-trigger kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: 10px system-ui, sans-serif; color: var(--muted); }
.content { max-width: 1660px; min-width: 0; margin: 0 auto; padding: 28px var(--shell-gutter) 52px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(23px, 2.1vw, 30px); font-weight: 760; line-height: 1.23; letter-spacing: -.035em; }
.page-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px;
  font-weight: 650; line-height: 1.35; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f3f8f4; border-color: #a7c7b9; color: var(--brand-dark); }
.btn.primary { color: white; background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #ecc8cc; }
.btn.danger:hover { background: #fbf1f2; border-color: #d799a0; }
.btn.flat { background: transparent; border-color: transparent; }
.btn.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.btn.icon-button { padding: 6px; min-width: 34px; }
.btn .icon, .text-link .icon { width: 16px; height: 16px; }
.buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 680; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2, .store-overview h2 { color: var(--ink); font-size: 15px; font-weight: 735; line-height: 1.4; }
.panel-head p, .store-overview p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.panel-body { padding: 17px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(241px, 1fr); gap: 15px; margin-bottom: 15px; }
.overview-panel-head { min-height: 65px; }
.range-picker { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #e5ece7; border-radius: 8px; background: #f4f7f4; white-space: nowrap; }
.range-button { border: 1px solid transparent; border-radius: 5px; background: transparent; min-height: 30px; padding: 3px 9px; color: var(--muted); font-size: 12px; font-weight: 650; }
.range-button[aria-pressed="true"] { border-color: #dbe7df; background: white; color: var(--brand-dark); box-shadow: 0 1px 2px #18423212; }
.range-button:hover { color: var(--brand-dark); }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.overview-metric { display: grid; gap: 7px; padding: 17px; min-width: 0; }
.overview-metric + .overview-metric { border-left: 1px solid var(--line); }
.overview-metric > span { color: var(--muted); font-size: 12px; font-weight: 640; }
.overview-metric strong { color: var(--ink); font-size: clamp(20px, 2.1vw, 30px); line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-metric small { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.timeline { padding: 14px 18px 16px; }
.timeline-legend { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 630; margin-bottom: 13px; }
.timeline-legend > span { width: 8px; height: 8px; border-radius: 2px; background: #13866d; }
.timeline-legend small { color: var(--muted); font-size: 10px; padding-left: 2px; }
.timeline-chart { display: grid; grid-template-columns: minmax(32px, max-content) minmax(0, 1fr); gap: 9px; height: 154px; }
.timeline-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-bottom: 17px; color: var(--soft); font-size: 10px; }
.timeline-plot { display: flex; align-items: stretch; min-width: 0; position: relative; border-bottom: 0; }
.timeline-plot::before { content: ""; position: absolute; inset: 4px 0 18px; border-bottom: 1px solid #dfeae4; background: repeating-linear-gradient(to bottom, #eaf0eb 0 1px, transparent 1px 50%); pointer-events: none; }
.timeline-day { display: grid; grid-template-rows: minmax(0, 1fr) 18px; min-width: 0; flex: 1; justify-items: center; align-items: end; z-index: 1; }
.timeline-bar { width: min(57%, 34px); min-width: 3px; height: var(--bar); max-height: calc(100% - 4px); border-radius: 4px 4px 0 0; background: #288d76; }
.timeline-bar.zero { height: 2px; background: #d9e9df; }
.timeline-day:hover .timeline-bar { background: #146d58; }
.timeline-date { white-space: nowrap; align-self: end; color: var(--soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.overview-rail { display: grid; grid-template-rows: 1fr auto; gap: 15px; min-width: 0; }
.queue-list { padding: 3px 14px; }
.queue-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 13px; gap: 9px; min-height: 50px; align-items: center; color: var(--ink); font-size: 13px; border-bottom: 1px solid #e9efeb; }
.queue-row:last-child { border-bottom: 0; }
.queue-row > .icon { width: 13px; height: 13px; color: #668075; }
.queue-row:hover { color: var(--brand-dark); }
.queue-row strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.queue-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #237b62; background: #e8f5ed; }
.queue-icon .icon { width: 16px; height: 16px; }
.queue-icon.amber { color: #925c20; background: #faefd9; }
.queue-icon.rose { color: #9f494e; background: #f8edee; }
.queue-icon.blue { color: #33678d; background: #eaf2f8; }
.store-overview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; }
.store-overview .btn { padding: 8px; }
.overview-bottom { margin-bottom: 0; }
.best-sellers { list-style: none; margin: 0; padding: 0 15px; }
.best-sellers li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e8eeea; font-size: 12px; }
.best-sellers li:last-child { border-bottom: 0; }
.best-sellers strong { line-height: 1.35; font-weight: 680; }
.best-sellers small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.best-sellers .amount { white-space: nowrap; }

.table-scroll { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; }
th { height: 38px; padding: 8px 12px; background: #f6f8f6; color: var(--muted); font-size: 12px; font-weight: 650; }
td { height: 51px; padding: 8px 12px; border-bottom: 1px solid #e8eeea; color: var(--ink); }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf8; }
.amount { color: var(--ink); font-weight: 730; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { font-weight: 690; }
.row-link { border: 0; padding: 0; background: none; color: var(--brand-dark); font-size: inherit; font-weight: 720; }
.row-link:hover { text-decoration: underline; }
.product-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.thumb { width: 36px; height: 36px; object-fit: cover; flex: none; display: grid; place-items: center; border-radius: 7px; background: #eaf0eb; color: #47695b; font-weight: 700; }
.customer-thumb { background: #e2f1e8; }
.customer-name { min-width: 0; }
.customer-name strong { font-weight: 680; }
.customer-mobile-email { display: none; color: var(--muted); }
.search-control { display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.search-control:focus-within { border-color: var(--brand); }
.search-control .icon { width: 16px; height: 16px; }
.search-control input { width: min(27vw, 240px); min-width: 76px; min-height: 35px; padding: 0; color: var(--ink); border: 0; outline: none; font-size: 12px; }
.empty-state { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.65; }
.empty-state strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 6px; background: #eef1ef; color: #526861; font-size: 11px; line-height: 1.24; font-weight: 660; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.good { background: #e8f5eb; color: #216746; }
.status.warn { background: #fbf1dc; color: #86581d; }
.status.bad { background: #faedf0; color: #a63c47; }
.status.info { background: #ebf2f8; color: #416787; }
.status.debug { background: var(--pale); color: var(--brand-dark); }

.inline-note { padding: 10px 12px; margin: 0 0 11px; border-radius: 8px; background: #eef6f1; color: #385d51; font-size: 13px; line-height: 1.56; }
.inline-note.error { background: #faedef; color: #9b3540; }
.form { display: grid; gap: 13px; }
.form .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.editor-group { min-width: 0; display: grid; gap: 13px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.editor-group legend { padding-inline: 5px; color: var(--muted); font-size: 12px; font-weight: 670; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.field .hint { color: var(--muted); font-size: 12px; font-weight: 450; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-weight: 450; }
.field textarea { min-height: 87px; resize: vertical; }
.field input:read-only { background: #f5f8f5; color: var(--muted); }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-footer .archive-action { margin-right: auto; }
.dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); box-shadow: 0 24px 90px #102e2954; }
.dialog::backdrop { background: #152f2a8c; }
.dialog .panel-body { overflow: auto; max-height: calc(100dvh - 94px); }
.errors:empty { display: none; }
.jump-menu { margin-block: min(17vh, 140px) auto; width: min(485px, calc(100vw - 24px)); }
.jump-search { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--muted); }
.jump-search input { min-width: 0; flex: 1; min-height: 35px; border: 0; outline: none; color: var(--ink); font-size: 14px; }
.jump-results { display: grid; padding: 7px; }
.jump-results a { display: grid; grid-template-columns: 19px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-height: 41px; padding: 8px 9px; color: var(--ink); border-radius: 7px; font-size: 13px; }
.jump-results a:hover, .jump-results a:focus-visible { background: var(--pale); }
.jump-results p { margin: 10px; color: var(--muted); font-size: 13px; }

.notices { position: fixed; inset: auto 18px 18px auto; z-index: 25; display: grid; gap: 7px; max-width: min(420px, calc(100vw - 36px)); }
.toast { border-radius: 8px; background: #173d32; color: white; padding: 11px 14px; font-size: 13px; box-shadow: 0 7px 21px #142b2840; }
.toast.bad { background: #9b3540; }
.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(370px, .93fr); background: #fff; }
.login-visual { min-height: 100dvh; display: flex; flex-direction: column; padding: clamp(25px, 5vw, 72px); background: var(--rail); color: white; }
.login-copy { margin: auto 0; padding: 30px 0; }
.login-copy .workspace-badge { color: #d1ede0; background: #255345; border-color: #3b6858; }
.login-copy .workspace-badge i { background: #8cddba; }
.login-copy h1 { font-size: clamp(32px, 4vw, 56px); line-height: 1.1; letter-spacing: -.055em; margin-block: 13px 12px; }
.login-copy p { color: #bcd5c9; font-size: 15px; line-height: 1.65; }
.login-main { display: grid; place-items: center; padding: 30px clamp(20px, 7vw, 80px); }
.login-card { width: 100%; max-width: 395px; }
.login-card h2 { font-size: 26px; letter-spacing: -.03em; margin-bottom: 6px; }
.login-card > p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 20px; }
.login-card .btn.primary { min-height: 40px; width: 100%; }
.demo-block { margin-top: 23px; padding-top: 14px; border-top: 1px solid var(--line); }
.demo-block strong { font-size: 13px; }
.demo-block .buttons { margin-top: 9px; }
.demo-block .btn { flex: 1; }

@media (max-width: 1190px) {
  .overview-order-fulfillment { display: none; }
}
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 195px minmax(0, 1fr); }
  .overview-order-date { display: none; }
  .overview-metric { padding: 13px 11px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(210px, .49fr); }
}
@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(260px, 89vw); height: 100dvh; display: none; }
  .nav-open .sidebar { display: flex; }
  .nav-open .nav-backdrop { position: fixed; display: block; z-index: 10; inset: 0; width: 100%; border: 0; background: #142b2870; }
  .btn.sidebar-dismiss, .btn.menu-toggle { display: inline-flex; }
}
@media (max-width: 690px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-rail { grid-template-rows: auto; gap: 12px; }
  .topbar { min-height: 53px; }
  .crumb-home, .crumbs > .icon, .top-actions .workspace-badge, .jump-trigger kbd, .jump-trigger span { display: none; }
  .btn.jump-trigger { padding: 6px; min-width: 34px; }
  .content { padding-top: 22px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: auto; padding: 21px; }
  .login-copy { padding-block: 22px 4px; }
  .login-copy h1 { font-size: 29px; margin-block: 10px 6px; }
  .login-main { padding: 24px 18px; }
}
@media (max-width: 520px) {
  :root { --shell-gutter: 13px; }
  .overview-panel-head { flex-wrap: wrap; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metric:nth-child(odd) { border-left: 0; }
  .overview-metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .overview-metric { gap: 5px; padding: 12px; }
  .overview-heading { align-items: center; }
  .overview-heading .btn, .top-actions .preview-link { padding-inline: 8px; }
  .table-scroll.overview-orders th, .table-scroll.overview-orders td, .customers-panel th, .customers-panel td { padding-inline: 7px; }
  .table-scroll.overview-orders th:first-child, .table-scroll.overview-orders td:first-child, .customers-panel th:first-child, .customers-panel td:first-child { padding-left: 11px; }
  .overview-orders td:nth-child(2), .overview-orders th:nth-child(2), .customer-email, .customer-date { display: none; }
  .customer-mobile-email { display: block; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
  .top-actions { gap: 5px; }
  .crumbs { gap: 4px; }
  .form .fields { grid-template-columns: 1fr; }
  .panel-head, .panel-body { padding: 12px; }
  .timeline { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
