:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #121417;
  --muted: #69717d;
  --line: #dfe3e8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --soft: #e8f3f1;
  --font-display: 32px;
  --font-page-title: 20px;
  --font-section-title: 14px;
  --font-body: 13px;
  --font-caption: 12px;
  --font-micro: 11px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-body);
  line-height: 1.5;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  min-height: 32px;
}

.hidden {
  display: none !important;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 40vw) 1fr;
  min-height: 100vh;
  background: #f7f9fc;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #1f7df3;
  color: #fff;
  padding: 48px;
}

.app-logo {
  width: 82px;
  height: 82px;
  border-radius: 16px;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(13, 61, 132, .22);
}

.auth-hero h1 {
  margin-top: 26px;
  font-size: 34px;
  line-height: 1.2;
}

.auth-hero p {
  font-size: 16px;
  font-weight: 650;
  opacity: .95;
}

.platform-cloud {
  width: 240px;
  height: 240px;
  margin-top: 30px;
  object-fit: contain;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 42px;
}

.auth-form {
  width: min(400px, 100%);
}

.auth-form h2 {
  margin-bottom: 32px;
  font-size: 26px;
}

.auth-form label {
  margin-bottom: 18px;
  color: #1f2937;
}

.auth-form input {
  min-height: 46px;
  border-color: #d9e1ea;
  background: #fbfdff;
  padding: 0 16px;
}

.terms-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px !important;
  color: #69717d !important;
  font-size: 13px;
  font-weight: 500;
}

.terms-row input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.terms-row button,
.support-link,
.auth-links button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: #1670df;
  padding: 0;
  font-weight: 700;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: #1670df;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
}

.auth-submit:disabled {
  background: #c7d1de;
  color: #fff;
  opacity: 1;
}

.auth-message,
.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.auth-message {
  margin-top: 12px;
  text-align: center;
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  color: #69717d;
  font-size: 14px;
}

.support-link {
  display: block;
  margin: 18px auto 0;
}

.client-shell {
  display: grid;
  grid-template-columns: 68px 1fr;
  height: 100vh;
  overflow: hidden;
  background: #f4f7fa;
}

.client-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid #dbe3ed;
  background: #edf3f9;
  color: #52647a;
}

.client-logo {
  width: 34px;
  height: 34px;
  margin-top: 28px;
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.client-account {
  width: 100%;
  margin: 8px 0 20px;
  text-align: center;
  font-size: 11px;
}

.client-nav {
  display: grid;
  width: 100%;
  gap: 2px;
}

.nav-item {
  display: grid;
  width: 100%;
  min-height: 56px;
  place-items: center;
  gap: 5px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #69778a;
  padding: 6px 0;
  font-size: 12px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: #eaf2fa;
  color: #314158;
}

.nav-item.active {
  border-left-color: #1670ff;
  background: #e6f1ff;
  color: #1670ff;
}

.nav-item.active .nav-icon {
  background: #d8eaff;
  padding: 3px;
  stroke-width: 2;
}

.nav-item.logout {
  color: #8a98aa;
}

.nav-item.logout:hover {
  color: #d92d20;
  background: #fff1f0;
}

.sidebar-bottom {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: auto;
  padding-bottom: 14px;
}

.version {
  text-align: center;
  color: #8a98aa;
  font-size: 11px;
}

.client-main {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

.client-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  border-bottom: 1px solid #dbe3ed;
  padding: 0 24px 0 20px;
}

.product-title {
  color: #52647a;
  font-size: 13px;
  font-weight: 700;
}

.subscription-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #52647a;
  font-size: 13px;
}

.subscription-line strong {
  font-weight: 800;
}

.renew-btn {
  min-height: 26px;
  border-color: #1670ff;
  color: #1670ff;
  padding: 0 10px;
}

.headset {
  width: 28px;
  min-height: 28px;
  margin-left: 10px;
  border: 0;
  background: transparent;
  color: #52647a;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.headset:hover {
  color: #1670ff;
}

.tab-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.tiktok-icon {
  background: #111827 url("/assets/tiktok-logo.svg") center / 16px 16px no-repeat;
  color: transparent;
}

.shopee-icon {
  background: #ef4444;
}

.shopify-icon {
  background: #78b84a;
}

.page-view {
  padding: 12px 20px 20px;
}

.monitor-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.monitor-platforms {
  display: grid;
  grid-template-columns: minmax(180px, 310px);
  height: 72px;
  border-bottom: 1px solid #dbe3ed;
  background: #f7fafc;
}

.monitor-platform {
  display: grid;
  place-items: center;
  gap: 5px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #263247;
  font-size: 13px;
  font-weight: 800;
}

.monitor-platform.active {
  border-bottom-color: #1670ff;
  color: #263247;
  background: #fff;
}

.monitor-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 20px 20px 0;
  overflow: hidden;
}

.monitor-status-line {
  display: none;
}

.monitor-orders-grid {
  height: 0;
  min-height: 126px;
  max-height: none;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.monitor-orders-grid.has-data {
  overflow-x: auto;
  overflow-y: auto;
}

.monitor-orders-grid table {
  width: 1120px;
  min-width: 1120px;
}

.order-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px 16px;
}

.monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.monitor-head h2 {
  margin: 0;
  font-size: 15px;
}

.print-stats {
  display: flex;
  gap: 16px;
  color: #52647a;
  font-size: 13px;
}

.toolbar-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.order-filter-strip {
  flex-wrap: nowrap;
  overflow: hidden;
}

.secondary-strip {
  margin-bottom: 10px;
}

.search-input {
  flex: 1 1 220px;
  min-width: 170px;
  max-width: 360px;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
}

.date-input {
  flex: 0 1 240px;
  min-width: 190px;
  max-width: 260px;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
}

.shop-select {
  flex: 1 1 220px;
  min-width: 150px;
  max-width: none;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
}

.compact-select,
.compact-input {
  min-height: 32px;
  border-radius: 5px;
  padding: 0 10px;
  font-size: 12px;
}

.compact-select {
  min-width: 118px;
}

.compact-input {
  width: 62px;
}

.small-primary,
.small-btn {
  min-height: 32px;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.small-primary {
  border-color: #1670ff;
  background: #1670ff;
  color: #fff;
}

.shop-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 26px;
  align-items: center;
  color: #52647a;
  font-size: 12px;
}

.order-page .shop-line {
  display: none;
}

.orders-grid {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #dbe3ed;
  background: #fff;
  scrollbar-gutter: stable;
}

.orders-grid.has-data {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-x: auto;
  overflow-y: auto;
}

.orders-grid table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}

.monitor-page .monitor-orders-grid {
  height: 0;
  min-height: 126px;
  max-height: none;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.monitor-page .monitor-orders-grid.has-data {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: auto;
}

.monitor-page .monitor-orders-grid table {
  width: 1120px;
  min-width: 1120px;
}

.orders-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f9;
  color: #52647a;
  font-size: 12px;
  white-space: nowrap;
}

.orders-grid th,
.orders-grid td {
  padding: 10px 12px;
  font-size: 12px;
  vertical-align: middle;
}

.orders-grid th:first-child,
.orders-grid td:first-child {
  width: 52px;
  text-align: center;
}

.orders-grid th:nth-child(2),
.orders-grid td:nth-child(2) {
  width: 72px;
}

.orders-grid th:nth-child(3),
.orders-grid td:nth-child(3) {
  width: 150px;
}

.orders-grid th:nth-child(4),
.orders-grid td:nth-child(4) {
  width: 220px;
}

.orders-grid th:nth-child(5),
.orders-grid td:nth-child(5) {
  width: 120px;
}

.orders-grid th:nth-child(6),
.orders-grid td:nth-child(6) {
  width: 130px;
}

.orders-grid th:nth-child(7),
.orders-grid td:nth-child(7) {
  width: 92px;
}

.orders-grid th:nth-child(8),
.orders-grid td:nth-child(8) {
  width: 120px;
}

.monitor-orders-grid th:nth-child(4),
.monitor-orders-grid td:nth-child(4) {
  width: 92px;
}

.monitor-orders-grid th:nth-child(5),
.monitor-orders-grid td:nth-child(5) {
  width: 220px;
}

.monitor-orders-grid th:nth-child(6),
.monitor-orders-grid td:nth-child(6) {
  width: 120px;
}

.monitor-orders-grid th:nth-child(7),
.monitor-orders-grid td:nth-child(7) {
  width: 130px;
}

.monitor-orders-grid th:nth-child(8),
.monitor-orders-grid td:nth-child(8) {
  width: 92px;
}

.monitor-orders-grid th:nth-child(9),
.monitor-orders-grid td:nth-child(9) {
  width: 120px;
}

.orders-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.order-page .hint {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 420px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.order-page .live {
  margin-left: auto;
  border-color: #8fd3c8;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.monitor-log {
  display: flex;
  flex: 0 0 176px;
  min-height: 176px;
  max-height: 176px;
  flex-direction: column;
  margin-top: 10px;
  border-top: 1px solid #dbe3ed;
  background: #f8fbff;
  overflow: hidden;
}

.monitor-page {
  background: #f8fbff;
}

.monitor-head,
.monitor-orders-grid {
  background: #fff;
}

.log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  color: #263247;
  font-size: 14px;
}

.empty-page {
  min-height: calc(100vh - 112px);
  display: grid;
  place-items: center;
  color: #8a98aa;
  font-weight: 700;
}

.shops-page {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 40px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.shop-platform-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #dbe3ed;
  background: #f5f9fd;
  padding: 22px 20px 36px;
}

.shop-platform-list h2 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  font-weight: 850;
}

.shop-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% + 40px);
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  margin-left: -20px;
  padding: 0 0 0 20px;
  font-size: 16px;
  font-weight: 750;
  text-align: left;
}

.shop-platform.active {
  background: #edf3fa;
  color: #1f2937;
}

.shop-platform.disabled {
  color: #344054;
  opacity: 1;
}

.shop-actions {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.shop-actions button {
  width: 110px;
  min-height: 40px;
  border-radius: 7px;
  background: #fff;
  color: #263247;
  border-color: #dbe3ed;
  font-size: 14px;
  font-weight: 750;
}

.shop-actions button:disabled {
  opacity: .72;
  cursor: wait;
}

.shop-table-panel {
  min-width: 0;
  padding: 20px 30px;
  overflow: auto;
}

.shop-table {
  width: 100%;
  min-width: 720px;
  border: 1px solid #dbe3ed;
  border-collapse: collapse;
  background: #fff;
}

.shop-table th {
  height: 42px;
  background: #f5f8fb;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.shop-table th:nth-child(1),
.shop-table td:nth-child(1) {
  width: 100px;
}

.shop-table th:nth-child(2),
.shop-table td:nth-child(2) {
  width: 200px;
}

.shop-table th:nth-child(3),
.shop-table td:nth-child(3) {
  width: 200px;
}

.shop-table th:nth-child(4),
.shop-table td:nth-child(4),
.shop-table th:nth-child(5),
.shop-table td:nth-child(5) {
  width: 100px;
}

.shop-table td {
  height: 52px;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid #dbe3ed;
}

.shop-table .empty-cell {
  height: 218px;
  color: #8aa0bd;
  font-size: 13px;
}

.link-danger {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #d92d20;
  padding: 0;
  font-weight: 800;
}

.link-action {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #1670ff;
  padding: 0 14px 0 0;
  font-weight: 800;
}

.template-page {
  min-height: calc(100vh - 82px);
  padding: 20px 28px;
}

.template-page h1 {
  margin: 0 0 28px;
  color: #111827;
  font-size: 22px;
  font-weight: 850;
}

.template-create-btn {
  min-width: 104px;
  min-height: 40px;
  margin-bottom: 20px;
  border-color: #1670ff;
  border-radius: 6px;
  background: #1670ff;
  color: #fff;
  font-weight: 850;
}

.template-table {
  width: 100%;
  border: 1px solid #dbe3ed;
  border-collapse: collapse;
  background: #fff;
}

.template-table th,
.template-table td {
  border: 1px solid #dbe3ed;
  text-align: center;
}

.template-table th {
  height: 44px;
  background: #f4f7fa;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
}

.template-table td {
  height: 48px;
  color: #263247;
  font-size: 13px;
}

.template-modal {
  position: relative;
  width: 408px;
  border-radius: 20px;
  background: #fbfbfd;
  padding: 28px 22px 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.template-modal h2 {
  margin: 0 0 34px;
  font-size: 20px;
}

.template-modal label {
  margin-bottom: 14px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
}

.template-modal input {
  min-height: 34px;
  border-color: #d9e1ea;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
}

.authorization-modal h2 {
  margin-bottom: 8px;
}

.authorization-modal select {
  min-height: 38px;
  margin-top: 7px;
  border-color: #d9e1ea;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
}

.authorization-hint,
.authorization-note {
  color: #69717d;
  font-size: 12px;
  line-height: 1.6;
}

.authorization-hint {
  margin: 0 0 22px;
}

.authorization-note {
  margin: 4px 0 0;
}

.template-size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
  color: #69717d;
  font-size: 12px;
}

.template-presets span {
  flex: 0 0 100%;
}

.template-presets button {
  min-height: 24px;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
}

.template-presets button.active {
  border-color: #1670ff;
  color: #1670ff;
  background: #eef6ff;
}

.template-modal .small-primary:disabled {
  border-color: #d1d5db;
  background: #d1d5db;
  color: #fff;
  cursor: not-allowed;
}

.template-modal .danger-solid {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 32px -22px 0;
  border-top: 1px solid #e5e7eb;
  padding: 12px 22px;
  background: #f4f4f5;
  border-radius: 0 0 20px 20px;
}

.template-designer {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 44px minmax(0, 1fr);
  background: #e9e9e9;
  z-index: 900;
}

.designer-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f1f1f;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
}

.designer-actions {
  display: flex;
  gap: 10px;
}

.designer-actions button {
  min-height: 32px;
  border-color: #5c5c5c;
  background: #1f1f1f;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.designer-actions .danger-solid {
  border-color: #ef4444;
  background: #ef4444;
}

.designer-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
  border-right: 1px solid #d0d0d0;
  background: #fff;
}

.designer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #dbe3ed;
}

.designer-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 12px;
}

.designer-tabs button.active {
  border-bottom-color: #111827;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid #dbe3ed;
}

.component-grid button {
  display: grid;
  height: 66px;
  min-height: 64px;
  place-items: center;
  gap: 4px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fbfdff;
  padding: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.component-grid button small {
  font-size: 12px;
  font-weight: 750;
}

.component-grid button:hover,
.data-rule-list button:hover {
  border-color: #1670ff;
  color: #1670ff;
  background: #eef6ff;
}

.component-grid span {
  font-size: 22px;
  color: #525866;
}

.data-rule-list {
  display: grid;
  gap: 7px;
  padding: 12px 10px 14px;
  border-bottom: 1px solid #dbe3ed;
}

.data-rule-list p {
  margin: 0 0 4px;
  color: #52647a;
  font-size: 12px;
  font-weight: 800;
}

.designer-rule-hint {
  display: block;
  margin: -2px 0 4px;
  color: #7a8aa0;
  font-size: 11px;
  line-height: 1.5;
}

.data-rule-list button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #dbe3ed;
  border-radius: 7px;
  background: #fbfdff;
  color: #344054;
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 750;
}

.data-rule-list button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.data-rule-list button span {
  font-size: 14px;
}

.data-rule-list button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.data-rule-list button em {
  display: none;
  border-radius: 4px;
  background: #22c55e;
  color: #fff;
  padding: 2px 6px;
  font-style: normal;
  font-size: 11px;
}

.data-rule-list button.bound,
.data-rule-list button.current {
  border-color: #22c55e;
  color: #15803d;
  background: #f0fdf4;
}

.data-rule-list button.occupied {
  border-color: #dbe3ed;
  color: #7a8aa0;
  background: #f8fafc;
}

.data-rule-list button.bound em,
.data-rule-list button.current em,
.data-rule-list button.occupied em {
  display: inline-block;
}

.data-rule-list button.occupied em {
  background: #94a3b8;
}

.property-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  color: #52647a;
  font-size: 12px;
}

.property-panel h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 13px;
}

.property-panel label,
.designer-size-inputs,
.color-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.property-panel input,
.property-panel select {
  min-height: 28px;
  border-color: #d9e1ea;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.designer-size-inputs {
  grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr);
}

.designer-size-inputs label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.designer-size-inputs input {
  width: 100%;
}

.color-row {
  grid-template-columns: 82px 28px 62px 28px;
}

.color-row input {
  width: 28px;
  padding: 0;
}

.designer-canvas-wrap {
  position: relative;
  overflow: auto;
  background: #e9e9e9;
  min-width: 0;
}

.designer-ruler.horizontal {
  position: sticky;
  top: 0;
  height: 32px;
  min-width: 1400px;
  margin-left: 32px;
  background: repeating-linear-gradient(to right, #c9c9c9 0 1px, transparent 1px 10px), #f6f6f6;
  border-bottom: 1px solid #d0d0d0;
  z-index: 2;
}

.designer-ruler.vertical {
  position: sticky;
  left: 0;
  width: 32px;
  height: 1200px;
  background: repeating-linear-gradient(to bottom, #c9c9c9 0 1px, transparent 1px 10px), #f6f6f6;
  border-right: 1px solid #d0d0d0;
  z-index: 2;
}

.designer-paper {
  position: absolute;
  top: 88px;
  left: 96px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px dashed #9ca3af;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .12);
}

.designer-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.designer-component {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 22px;
  border: 1px solid transparent;
  color: #111827;
  font-size: 13px;
  user-select: none;
  cursor: move;
}

.designer-component.selected {
  border-color: #1670ff;
  box-shadow: 0 0 0 2px rgba(22, 112, 255, .14);
}

.designer-component.selected::before {
  content: attr(data-size);
  position: absolute;
  left: 0;
  top: -18px;
  border-radius: 3px;
  background: #ff2d20;
  color: #fff;
  padding: 1px 4px;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.designer-component.selected::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  right: -10px;
  top: 50%;
  border-radius: 50%;
  background: #ff7a00;
  box-shadow: -68px -20px 0 #ff7a00, -68px 20px 0 #ff7a00;
  transform: translateY(-50%);
}

.designer-component.text,
.designer-component.field {
  justify-content: start;
  padding: 2px 5px;
  background: rgba(255, 255, 255, .72);
}

.designer-component.field {
  color: #111827;
  background: rgba(17, 24, 39, .12);
}

.designer-component.image {
  border: 1px dashed #94a3b8;
  background: #f1f5f9;
  color: #98a2b3;
}

.designer-image-placeholder {
  display: grid;
  place-items: center;
  gap: 3px;
  color: #94a3b8;
  line-height: 1;
  pointer-events: none;
}

.designer-image-placeholder b {
  font-size: 20px;
  font-weight: 500;
}

.designer-image-placeholder small {
  font-size: 11px;
}

.designer-component.line {
  min-height: 2px;
  height: 2px;
  background: #111827;
}

.designer-component.rect,
.designer-component.circle {
  border: 2px solid #111827;
  background: rgba(255, 255, 255, .3);
}

.designer-component.circle {
  border-radius: 999px;
}

.designer-delete-btn {
  min-height: 30px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff5f5;
  color: #d92d20;
  font-size: 12px;
  font-weight: 800;
}

.paper-placeholder {
  position: relative;
  z-index: 1;
  display: none;
  width: 82px;
  height: 82px;
  place-items: center;
  background: #f3f4f6;
  color: #b8bec8;
  font-size: 26px;
}

.paper-placeholder small {
  font-size: 10px;
}

.designer-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
  padding: 8px 14px;
  color: #40516a;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}

.settings-page {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
  height: calc(100vh - 40px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.settings-menu {
  height: 100%;
  border-right: 1px solid #dbe3ed;
  background: #f3f7fb;
  padding: 18px 0;
}

.settings-menu h1 {
  margin: 0 18px 20px;
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

.settings-menu-item {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #314158;
  padding: 0 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}

.settings-menu-item.active {
  background: #e9eff6;
  color: #111827;
}

.settings-content {
  min-width: 0;
  overflow: auto;
  padding: 20px 24px 20px 0;
}

.settings-panel h2 {
  margin: 0 0 22px;
  color: #111827;
  font-size: 20px;
  font-weight: 850;
}

.settings-panel h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
}

.settings-card {
  width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid #dbe3ed;
  padding: 0 18px;
  color: #1f2937;
  font-size: 13px;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row strong {
  color: #40516a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.settings-row button {
  min-width: 64px;
  min-height: 30px;
  border-radius: 6px;
  font-size: 12px;
}

.avatar-settings-row {
  min-height: 72px;
}

.settings-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
  vertical-align: middle;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(2px);
  z-index: 1000;
}

.pay-modal {
  position: relative;
  width: 360px;
  border-radius: 8px;
  background: #fff;
  padding: 22px 22px 18px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.support-modal {
  position: relative;
  width: 330px;
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.support-modal h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.support-modal p {
  color: #69717d;
  font-size: 14px;
}

.legal-modal {
  position: relative;
  width: min(680px, calc(100vw - 48px));
  max-height: min(78vh, 720px);
  border-radius: 8px;
  background: #fff;
  padding: 24px 26px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.legal-modal h2 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 22px;
}

.legal-content {
  max-height: calc(min(78vh, 720px) - 76px);
  overflow: auto;
  padding-right: 8px;
  color: #40516a;
  font-size: 13px;
  line-height: 1.75;
}

.legal-content h3 {
  margin: 18px 0 6px;
  color: #111827;
  font-size: 15px;
}

.legal-content p {
  margin: 0 0 8px;
}

.template-preview-modal {
  position: relative;
  width: min(820px, calc(100vw - 48px));
  max-height: min(82vh, 720px);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.preview-head {
  border-bottom: 1px solid #e5eaf2;
  padding: 20px 24px 14px;
}

.preview-head h2 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 22px;
}

.preview-head p {
  color: #69717d;
  font-size: 13px;
}

.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 20px 24px 24px;
}

.preview-paper-wrap {
  display: grid;
  min-height: 420px;
  place-items: center;
  overflow: auto;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #eef1f5;
}

.preview-paper {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #aab4c0;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .16);
}

.preview-layer {
  position: absolute;
  inset: 0;
}

.preview-info {
  min-width: 0;
}

.preview-info h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 14px;
}

.preview-info h3 + .preview-info-rows,
.preview-info h3 + .preview-field-rows {
  margin-bottom: 18px;
}

.preview-info-row,
.preview-field-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  color: #40516a;
  font-size: 12px;
}

.preview-info-row span,
.preview-field-row span {
  color: #8a98aa;
}

.preview-info-row strong,
.preview-field-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #263247;
}

.preview-component {
  position: absolute;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 13px;
}

.preview-component.text,
.preview-component.field {
  justify-content: start;
  padding: 2px 5px;
}

.preview-component.field {
  color: #0f766e;
  background: #ecfdf3;
}

.preview-component.image {
  border: 1px dashed #94a3b8;
  background: #f1f5f9;
  color: #98a2b3;
}

.preview-component.line {
  min-height: 2px;
  background: #111827;
}

.preview-component.rect,
.preview-component.circle {
  border: 2px solid #111827;
  background: rgba(255, 255, 255, .3);
}

.preview-component.circle {
  border-radius: 999px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #52647a;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #111827;
}

.mac-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .46);
  backdrop-filter: blur(8px);
  z-index: 1400;
}

.mac-dialog {
  width: min(340px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  background: rgba(50, 50, 52, .94);
  color: #fff;
  padding: 22px 18px 14px;
  text-align: center;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.mac-dialog h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.mac-dialog p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.55;
}

.mac-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.mac-dialog-btn {
  height: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 750;
}

.mac-dialog-btn.cancel {
  background: rgba(255, 255, 255, .16);
}

.mac-dialog-btn.cancel:hover {
  background: rgba(255, 255, 255, .22);
}

.mac-dialog-btn.ok {
  background: #0a84ff;
}

.mac-dialog-btn.ok:hover {
  background: #2493ff;
}

.pay-modal h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.pay-modal p {
  color: #69717d;
  font-size: 13px;
  line-height: 1.45;
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 10px;
}

.plan-option {
  display: grid;
  min-height: 66px;
  border-color: #dbe3ed;
  border-radius: 8px;
  background: #fff;
  padding: 7px 6px;
  color: #40516a;
  text-align: center;
}

.plan-option strong {
  color: #111827;
  font-size: 15px;
}

.plan-option span {
  color: #1670ff;
  font-size: 14px;
  font-weight: 850;
}

.plan-option small {
  color: #69717d;
  font-size: 11px;
}

.plan-option.active {
  border-color: #1670ff;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px #1670ff;
}

.qr-wrap {
  display: grid;
  width: 226px;
  height: 226px;
  place-items: center;
  margin: 12px auto 10px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
}

.qr-wrap img {
  width: 208px;
  height: 208px;
}

.support-qr-wrap {
  display: grid;
  width: 252px;
  height: 252px;
  place-items: center;
  margin: 20px auto 0;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
}

.support-qr-wrap img {
  width: 232px;
  height: 232px;
}

.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #16181d;
  color: #fff;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
}

.brand p,
.hint,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.section-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

.panel label,
.panel button {
  margin-bottom: 12px;
}

.shops {
  display: grid;
  gap: 8px;
}

.shop-item {
  width: 100%;
  min-height: 64px;
  padding: 10px;
  text-align: left;
}

.shop-item.active {
  border-color: var(--accent);
  background: var(--soft);
}

.shop-item strong {
  display: block;
  margin-bottom: 4px;
}

.shop-item span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.toolbar,
.orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar {
  margin-bottom: 18px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h2 {
  margin-top: 3px;
  font-size: 24px;
}

.live {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
}

.live.ok {
  border-color: #8fd3c8;
  color: var(--accent-dark);
  background: var(--soft);
}

.shop-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.filters {
  display: grid;
  grid-template-columns: 220px 120px auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.orders,
.events {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 18px;
}

.orders-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.orders-head span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

td {
  overflow-wrap: anywhere;
}

.status {
  display: inline-block;
  border-radius: 999px;
  background: #edf2f7;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 750;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.orders-grid .empty-cell {
  height: 46px;
}

.events-log {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 3px;
  min-height: 0;
  overflow: auto;
  padding: 8px 16px;
}

.event {
  display: grid;
  grid-template-columns: 28px 150px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #263247;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.25;
}

.event time {
  display: inline;
  color: var(--muted);
}

.event-index {
  color: #8aa0bd;
  text-align: right;
}

.event strong {
  font-weight: 650;
}

.event pre {
  display: inline;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error {
  color: var(--danger);
}

/* Typography scale: display 32, page title 20, section title 14, body 13, auxiliary 12. */
h1,
h2,
h3,
p {
  margin: 0;
}

h1,
.template-page h1,
.settings-panel h2,
.shop-platform-list h2,
.template-modal h2,
.support-modal h2,
.legal-modal h2,
.preview-head h2,
.pay-modal h2 {
  font-size: var(--font-page-title);
  line-height: 1.35;
  font-weight: 850;
}

.auth-hero h1 {
  font-size: var(--font-display);
}

.auth-form h2 {
  font-size: 24px;
  line-height: 1.35;
}

.monitor-head h2 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 850;
}

.settings-panel h3,
.preview-info h3,
.legal-content h3,
.property-panel h3,
.section-title {
  font-size: var(--font-section-title);
  line-height: 1.4;
  font-weight: 850;
}

.auth-hero p,
.support-modal p,
.legal-content,
.pay-modal p,
.preview-template-meta,
.settings-row,
.shop-platform,
.search-input,
.date-input,
.shop-select,
label {
  font-size: var(--font-body);
}

.small-primary,
.small-btn,
.compact-select,
.compact-input,
.orders-grid th,
.orders-grid td,
.shop-table th,
.shop-table td,
.template-table td,
.template-table th,
.events-log,
.hint,
.empty-cell {
  font-size: var(--font-caption);
}

.client-account,
.data-rule-list button em,
.designer-rule-hint,
.preview-info-row,
.preview-field-row {
  font-size: var(--font-micro);
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 320px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shop-detail,
  .filters {
    grid-template-columns: 1fr;
  }

  .settings-page {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 16px;
  }

  .settings-menu h1 {
    margin-inline: 14px;
    font-size: 16px;
  }

  .settings-menu-item {
    padding-inline: 14px;
    font-size: 12px;
  }

  .settings-content {
    padding-right: 14px;
  }

  .settings-row {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 14px;
  }
}
