:root {
  --ui-scale: 0.8;
  --nav-bg: #2f3550;
  --nav-bg-deep: #252b41;
  --nav-line: rgba(255, 255, 255, 0.08);
  --nav-text: rgba(255, 255, 255, 0.76);
  --nav-active: #ffffff;
  --workspace-bg: #f4f6ff;
  --surface: #ffffff;
  --surface-soft: #f7f9ff;
  --line: #e6ebf5;
  --text: #22304a;
  --muted: #7a879d;
  --primary: #4e7de3;
  --primary-deep: #2f65db;
  --warn-bg: #fff1db;
  --warn-text: #ef8f14;
  --danger: #c75246;
  --shadow: 0 10px 30px rgba(34, 48, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: calc(16px * var(--ui-scale));
}

body {
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--workspace-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.quick-link {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

button:hover,
.quick-link:hover {
  background: var(--primary-deep);
}

.quick-link.secondary,
.quiet-button {
  background: #fff;
  color: #4d5c78;
  border: 1px solid var(--line);
}

.quick-link.secondary:hover,
.quiet-button:hover {
  background: #f7f9ff;
}

button.danger {
  background: var(--danger);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d9e0ef;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input[type='checkbox'] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
  accent-color: #3d6df2;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 44px;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #7f8da6 50%),
    linear-gradient(135deg, #7f8da6 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #9bb7f7;
  box-shadow: 0 0 0 3px rgba(78, 125, 227, 0.12);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #5f6d84;
  font-weight: 600;
}

.upload-field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #5f6d84;
  font-weight: 600;
}

.upload-row {
  display: grid;
  gap: 12px;
}

.review-image-side {
  display: grid;
  gap: 8px;
  align-content: flex-start;
}

.upload-stack {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.upload-paste-hint {
  margin-top: 0;
}

.field-hint {
  margin-top: -4px;
  color: #8190a8;
  font-size: 12px;
  line-height: 1.7;
}

.buyer-recommendations {
  margin-top: 8px;
}

.buyer-recommendation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.buyer-recommendation {
  border: 1px solid #d6e0f5;
  background: #f7faff;
  color: #496699;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.buyer-recommendation:hover {
  border-color: #8cabf0;
  color: #3157b7;
}

.success-banner {
  color: #23674b;
  background: #e8f7ef;
  border: 1px solid #cfeedd;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 18px;
  font-size: 13px;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  color: #8794ab;
  font-weight: 600;
  background: #fafcff;
}

pre,
p {
  margin: 0;
}

.guest-body {
  background:
    linear-gradient(135deg, rgba(78, 125, 227, 0.08), transparent 30%),
    linear-gradient(180deg, #eef3ff 0%, #f7f9ff 100%);
}

.guest-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  zoom: var(--ui-scale);
}

.login-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(34, 48, 74, 0.12);
  padding: 32px;
  display: grid;
  gap: 18px;
}

.login-copy h1 {
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.login-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 32px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.login-form {
  margin-top: 4px;
}

.login-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.app-shell {
  min-height: calc(100vh / var(--ui-scale));
  display: flex;
  zoom: var(--ui-scale);
}

.sidebar {
  width: 98px;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-deep) 100%);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 18px;
  flex-shrink: 0;
}

.sidebar-brand {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nav-line);
}

.sidebar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #d7e3ff);
  color: var(--primary-deep);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
}

.sidebar-nav {
  width: 100%;
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.side-link {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: 12px;
  color: var(--nav-text);
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.side-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--nav-active);
}

.side-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.side-label {
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid var(--nav-line);
  text-align: center;
}

.sidebar-footer-link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-topbar {
  background: #fff;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
}

.top-tabs {
  display: flex;
  align-items: center;
  gap: 34px;
  min-width: 0;
  overflow-x: auto;
}

.top-tab {
  position: relative;
  padding: 22px 0 20px;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  color: #627391;
}

.top-tab.active {
  color: #24324c;
}

.top-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-meta {
  color: #7c89a3;
  font-size: 13px;
}

.top-user {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f5f8ff;
  color: #425473;
  font-size: 13px;
  font-weight: 600;
}

.top-rate-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: #4f6283;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.logout-form {
  margin: 0;
}

.notice-bar {
  margin: 18px 28px 0;
  padding: 10px 16px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.notice-bar span {
  font-weight: 700;
  white-space: nowrap;
}

.notice-bar p {
  line-height: 1.55;
}

.workspace-main {
  flex: 1;
  padding: 22px 28px 28px;
}

.overview-strip,
.stage-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.overview-strip {
  padding: 22px 22px 18px;
}

.overview-header,
.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.overview-header h2,
.stage-head h3,
.empty-state h3 {
  margin: 0;
}

.overview-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.overview-header p,
.stage-head p,
.empty-state p,
.section-note {
  color: var(--muted);
  line-height: 1.65;
}

.section-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-home-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-card {
  background: var(--surface-soft);
  border: 1px solid #e7edf9;
  border-radius: 10px;
  padding: 16px 18px;
}

.summary-card span,
.detail-grid span {
  display: block;
  font-size: 12px;
  color: #8593aa;
  margin-bottom: 8px;
}

.summary-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}

.analytics-panel {
  padding: 16px 22px 16px;
}

.analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.analytics-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.analytics-head p {
  margin: 0;
  color: var(--muted);
}

.analytics-period-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.overview-strip.analytics-panel {
  padding-top: 24px;
  padding-bottom: 24px;
}

.overview-strip.analytics-panel .summary-card {
  min-height: 124px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.range-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.range-tab {
  min-width: 78px;
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
  color: #566783;
  border-right: 1px solid var(--line);
}

.range-tab:last-child {
  border-right: 0;
}

.range-tab.active {
  background: #f0f5ff;
  color: var(--primary-deep);
}

.analytics-date-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.analytics-date-form label {
  margin: 0;
}

.analytics-date-form input {
  min-width: 148px;
}

.analytics-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 14px;
}

.mini-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(34, 48, 74, 0.04);
}

.mini-stat span {
  display: block;
  font-size: 12px;
  color: #8593aa;
  margin-bottom: 8px;
}

.mini-stat strong {
  display: block;
  font-size: 22px;
}

.mini-stat.primary-accent {
  border-left: 4px solid #3d6df2;
}

.mini-stat.success-accent {
  border-left: 4px solid #4caf50;
}

.mini-stat.warm-accent {
  border-left: 4px solid #f3a43b;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5f6f8c;
  font-size: 13px;
  font-weight: 600;
}

.chart-legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 168px;
}

.chart-grid-line {
  stroke: #dfe6f4;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.chart-axis-label {
  fill: #8b98ae;
  font-size: 12px;
}

.fee-breakdown {
  display: grid;
  gap: 18px;
}

.fee-breakdown-bar {
  display: flex;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3fb;
}

.fee-segment {
  display: block;
  height: 100%;
}

.goods-segment {
  background: #3d6df2;
}

.service-segment {
  background: #f3c23b;
}

.total-segment {
  background: #5ab7a5;
}

.fee-breakdown-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fee-breakdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.fee-breakdown-item i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.fee-breakdown-item span {
  color: #61718d;
  font-size: 13px;
  flex: 1;
}

.fee-breakdown-item strong {
  font-size: 18px;
}

@media (max-width: 1180px) {
  .analytics-mini-grid,
  .fee-breakdown-list {
    grid-template-columns: 1fr;
  }

  .analytics-date-form {
    align-items: stretch;
  }

  .analytics-date-form input,
  .analytics-date-form button {
    width: 100%;
  }
}

.summary-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 600;
}

.stage-meta-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-panel {
  padding: 18px 20px 20px;
}

.form-panel {
  background: #fff;
}

.narrow-stage {
  max-width: 820px;
}

.batch-stage {
  max-width: none;
  width: 100%;
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.buyer-create-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.buyer-create-submit {
  grid-column: 1 / -1;
}

.filter-toolbar {
  display: grid;
  gap: 14px;
  margin: 10px 0 16px;
  padding: 14px 16px;
  border: 1px solid #e7edf8;
  border-radius: 12px;
  background: #f9fbff;
}

.client-order-filter-toolbar {
  margin-bottom: 28px;
}

.filter-grid {
  display: grid;
  gap: 14px;
  align-items: end;
}

.task-filter-grid {
  grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr));
}

.admin-task-filter-grid {
  grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr));
}

.ledger-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 220px));
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.export-actions {
  margin-top: 12px;
}

.filter-actions .js-export-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.compact-public-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.compact-span-3 {
  grid-column: span 3;
}

.compact-span-5 {
  grid-column: span 5;
}

.public-title {
  grid-column: span 6;
}

.public-short {
  grid-column: span 3;
}

.public-time {
  grid-column: span 3;
}

.public-note {
  grid-column: span 9;
}

.public-note textarea {
  height: 44px;
  min-height: 44px;
}

.form-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-lite-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.compact-fields {
  align-items: end;
  align-self: start;
}

.conditional-fields.is-hidden {
  display: none;
}

.product-review-fields.is-hidden,
.is-hidden {
  display: none;
}

.batch-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.secondary-pill {
  background: #f3f7ff;
  color: #4f6283;
}

.secondary-pill strong,
.total-pill strong {
  color: var(--primary-deep);
}

.total-pill {
  background: #ecf4ff;
}

.product-list-panel {
  background: #f8fbff;
  border: 1px solid #e4ecfb;
  border-radius: 12px;
  padding: 16px;
}

.product-grid,
.task-board {
  display: grid;
  gap: 16px;
}

.task-batch-board {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.order-list-board,
.order-detail-board {
  display: grid;
  gap: 16px;
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
}

.task-board {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.task-batch {
  background: #f9fbff;
  border: 1px solid #e6edf9;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}

.order-list-card,
.order-detail-task-panel {
  background: #f9fbff;
}

.order-detail-overview {
  padding: 16px 18px 14px;
}

.order-detail-overview h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.task-batch[open] {
  box-shadow: 0 12px 28px rgba(41, 69, 125, 0.06);
}

.task-batch-head {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
}

.task-batch-head::-webkit-details-marker {
  display: none;
}

.task-batch-kicker {
  color: #8b98af;
  font-size: 12px;
  margin-bottom: 6px;
}

.task-batch-head h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.task-batch-head h4 a {
  color: inherit;
}

.task-batch-meta {
  margin-top: 6px;
  color: #7f8ca4;
  font-size: 12px;
}

.order-detail-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.task-batch-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form-actions {
  margin: 0;
}

.batch-badge,
.batch-metric {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: #4f6283;
  font-size: 13px;
  font-weight: 600;
}

.batch-badge {
  background: #eef6e9;
  color: #4b7a3b;
}

.compact-link {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pt-label,
.pt-value {
  display: inline-block;
  margin-left: 4px;
  color: #7d8aa4;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.pt-value {
  margin-left: 6px;
  color: #5f6f8d;
}

.task-batch .task-board {
  padding: 0 20px 20px;
}

.page-summary-actions {
  margin: 18px 0 0;
}

.order-detail-task-head {
  border-bottom: 1px solid #e8eef8;
}

.order-detail-task-panel > .detail-grid,
.order-detail-task-panel > .stage-panel,
.order-detail-task-panel > .detail-media-section {
  padding-left: 20px;
  padding-right: 20px;
}

.compact-task-head {
  padding: 14px 16px;
}

.compact-task-head h4 {
  font-size: 17px;
}

.compact-stage-panel {
  margin-top: 16px;
}

.inline-block-text {
  min-height: auto;
  margin-top: 8px;
}

.truncated-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.detail-media-section {
  margin-top: 16px;
}

.detail-media-section > span {
  display: block;
  color: #8190a8;
  font-size: 13px;
  font-weight: 600;
}

.product-list-head,
.product-card-head,
.inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.submit-row {
  display: flex;
  justify-content: flex-end;
}

.compact-submit,
.inline-actions button {
  width: 8.5rem;
  min-width: 8.5rem;
}

.product-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.product-card-head .copy-product,
.product-card-head .remove-product {
  width: 6rem;
  min-width: 6rem;
  white-space: nowrap;
}

.product-card-head h4,
.product-list-head > div:first-child {
  flex: 1;
}

.product-card {
  background: #fff;
  border: 1px solid #e7edf8;
  border-radius: 12px;
  padding: 16px;
}

.product-card .form-grid {
  align-items: start;
}

.product-review-fields {
  align-items: start;
}

.product-review-fields label,
.product-review-fields .upload-field {
  align-content: start;
}

.task-card {
  background: #f9fbff;
  border: 1px solid #e6edf9;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card-id {
  color: #7e8ca5;
  font-size: 12px;
  margin-bottom: 4px;
}

.task-card h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.task-card-meta {
  color: #5f6d84;
  line-height: 1.6;
}

.task-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-card-stats div {
  background: #fff;
  border: 1px solid #e6edf8;
  border-radius: 10px;
  padding: 12px;
}

.task-card-stats span,
.task-card-foot span {
  color: #8391a8;
  font-size: 12px;
}

.task-card-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.task-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.task-card-foot a {
  color: var(--primary-deep);
  font-weight: 600;
}

.product-card h4,
.product-list-head h3 {
  margin: 0;
}

.three-col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.buyer-name-cell {
  font-weight: 600;
  vertical-align: middle;
}

.buyer-auto-save-form {
  display: none;
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 40px;
  padding: 0 8px;
  color: #6f7f99;
  font-size: 12px;
  font-weight: 600;
}

.autosave-status.is-dirty {
  color: #7a879d;
}

.autosave-status.is-saving {
  color: #3157b7;
}

.autosave-status.is-saved {
  color: #3b7a50;
}

.autosave-status.is-error {
  color: #c75246;
}

.grid-form {
  width: 100%;
  display: grid;
  grid-template-columns: 110px 1fr auto;
}

.table-surface {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid #edf1f8;
  border-radius: 10px;
}

.selection-col {
  width: 54px;
  text-align: center;
  vertical-align: middle;
}

.selection-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
}

.selection-toggle input {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3d6df2;
}

#buyer-list td {
  vertical-align: middle;
}

#buyer-list table {
  width: 100%;
  table-layout: fixed;
}

#buyer-list thead th,
#buyer-list tbody td {
  vertical-align: middle;
}

#buyer-list .selection-col,
#buyer-list .selection-col-group {
  width: 44px;
  text-align: center;
}

#buyer-list .buyer-grade-col-group {
  width: 180px;
}

#buyer-list .buyer-name-col-group {
  width: 220px;
}

#buyer-list .buyer-phone-col-group {
  width: 260px;
}

#buyer-list .buyer-referral-col-group {
  width: 180px;
}

#buyer-list .buyer-action-col-group {
  width: 120px;
}

#buyer-list td input:not([type='checkbox']),
#buyer-list td select,
#buyer-list td textarea {
  min-height: 40px;
  width: 100%;
}

#buyer-list thead .selection-toggle,
#buyer-list tbody .selection-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  margin: 0 auto;
  line-height: 1;
}

#buyer-list thead .selection-toggle input,
#buyer-list tbody .selection-toggle input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#buyer-list .buyer-row-actions {
  white-space: nowrap;
  text-align: center;
}

#buyer-list tbody .selection-col {
  line-height: 1;
  vertical-align: middle;
}

#buyer-list .buyer-inline-form {
  display: contents;
}

#buyer-list thead .selection-col,
#buyer-list tbody .selection-col {
  padding-left: 8px;
  padding-right: 8px;
}

#buyer-list thead .selection-toggle input:focus-visible,
#buyer-list tbody .selection-toggle input:focus-visible {
  outline: 2px solid rgba(61, 109, 242, 0.28);
  outline-offset: 2px;
}

#buyer-list .buyer-name-cell p {
  margin: 0;
}

#buyer-list .buyer-display-value {
  display: block;
  min-height: 40px;
  padding: 11px 0;
  line-height: 18px;
  color: var(--text);
  font-weight: 600;
}

#buyer-list .buyer-edit-field.is-hidden,
#buyer-list .buyer-display-value.is-hidden {
  display: none;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-submitted {
  background: #ebf2ff;
  color: #3568d5;
}

.status-in_review {
  background: #ebf2ff;
  color: #3568d5;
}

.status-awaiting_payment {
  background: #fff4df;
  color: #a46a00;
}

.status-in_progress {
  background: #ebf2ff;
  color: #3568d5;
}

.status-completed {
  background: #e9f8ee;
  color: #2f8a4b;
}

.status-rejected {
  background: #fdeeee;
  color: #b74b3d;
}

.status-client-active {
  background: #ebf2ff;
  color: #3568d5;
}

.status-cancelled {
  background: #fff4df;
  color: #a46a00;
}

.detail-grid,
.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.compact-grid p {
  font-size: 15px;
  font-weight: 600;
}

.task-meta-grid p {
  line-height: 1.7;
  word-break: break-word;
}

.text-block {
  background: #f8faff;
  border: 1px solid #e8eef8;
  border-radius: 10px;
  padding: 14px 16px;
  line-height: 1.8;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 16px;
}

.result-image {
  display: block;
  width: 100%;
  margin-top: 16px;
  border-radius: 10px;
  border: 1px solid #e8eef8;
}

.inline-result-image {
  max-width: 220px;
  margin-top: 8px;
}

.order-result-image {
  max-width: 110px;
  margin-top: 8px;
}

.inline-image-grid,
.review-image-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
}

.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-dropzone {
  width: 100%;
  min-width: 0;
  min-height: 120px;
  display: block;
  padding: 11px 12px;
  border: 1px solid #d9e0ef;
  border-radius: 8px;
  background: #fff;
  color: #22304a;
  text-align: left;
  cursor: text;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.upload-dropzone:hover {
  border-color: #c7d5ee;
  background: #fff;
}

.upload-dropzone:focus,
.upload-dropzone:focus-visible {
  outline: none;
  border-color: #84a8f6;
  box-shadow: 0 0 0 3px rgba(132, 168, 246, 0.15);
}

.upload-dropzone.is-hidden,
.order-upload-hint.is-hidden,
.completion-upload-hint.is-hidden {
  display: none;
}

.upload-dropzone-text {
  display: block;
  width: 100%;
  font-size: 14px;
  line-height: 1.7;
  color: #98a4b8;
  font-weight: 500;
}

.upload-paste-textarea {
  resize: vertical;
  font: inherit;
  line-height: 1.7;
  min-height: 120px;
  background: #fff;
  border-style: solid;
}

.preview-thumb {
  position: relative;
  margin: 0;
}

.preview-thumb img,
.inline-image-grid img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e6edf8;
  background: #fff;
}

.preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 50%;
  background: rgba(34, 48, 74, 0.85);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.preview-remove:hover {
  background: #1d2638;
}

.preview-thumb:hover .preview-remove,
.preview-thumb:focus-within .preview-remove {
  opacity: 1;
  pointer-events: auto;
}

.review-image-text-preview {
  align-items: center;
}

.order-upload-field {
  margin-bottom: 6px;
}

.order-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.order-dropzone {
  min-height: 124px;
}

.order-image-preview {
  min-height: 92px;
}

.order-upload-hint {
  margin: 0;
}

.order-proof-cell {
  margin-top: 10px;
}

.order-meta-grid {
  align-items: start;
}

.order-detail-meta-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: start;
}

.order-detail-meta-grid .meta-span-two {
  grid-column: span 2;
}

.order-detail-meta-grid .meta-span-three {
  grid-column: span 3;
}

.order-proof-cell .inline-result-image {
  max-width: 110px;
  margin-top: 4px;
}

.order-screenshot-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}

.completed-detail-card {
  padding-bottom: 14px;
}

.completed-detail-card > .detail-grid,
.completed-detail-card > form.detail-grid {
  padding-left: 16px;
  padding-right: 16px;
}

.completed-detail-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.completed-detail-grid > .meta-span-two {
  grid-column: span 2;
}

.completed-detail-grid > .meta-span-three {
  grid-column: span 3;
}

.compact-text-block {
  min-height: 64px;
  margin-top: 8px;
  padding: 10px 12px;
  line-height: 1.6;
}

.compact-proof-cell {
  margin-top: 8px;
}

.compact-proof-cell .inline-result-image,
.completed-detail-card .inline-result-image,
.completed-detail-card .order-result-image {
  max-width: 88px;
  margin-top: 0;
}

.completed-detail-card .result-image {
  margin-top: 0;
}

.completed-detail-card .order-upload-field,
.completed-detail-card .completion-upload-field {
  margin-bottom: 0;
}

.completed-detail-card .order-upload-side {
  gap: 6px;
}

.completed-detail-card .order-image-preview,
.completed-detail-card .completion-image-preview {
  min-height: auto;
}

.completed-detail-card .upload-row.order-upload-row {
  align-items: flex-start;
}

.completed-detail-card .order-screenshot-pair {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.completed-edit-grid textarea {
  min-height: 84px;
}

.completed-edit-actions {
  display: flex;
  align-items: flex-end;
}

.completed-edit-actions button {
  min-width: 140px;
}

.completed-edit-section {
  display: grid;
  gap: 16px;
}

.completed-edit-section button {
  justify-self: start;
  min-width: 180px;
}

.review-image-text-preview .preview-remove {
  position: static;
}

.error-hint {
  color: #b5483b;
}

.empty-panel {
  min-height: 520px;
  display: grid;
  place-items: center;
  background: rgba(244, 246, 255, 0.78);
}

.empty-state {
  text-align: center;
  max-width: 320px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.empty-illustration {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 70% 36%, rgba(141, 189, 255, 0.3), rgba(141, 189, 255, 0) 18%),
    linear-gradient(180deg, #d9ebff 0%, #c8e0ff 100%);
  position: relative;
}

.empty-illustration::before,
.empty-illustration::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 8px;
}

.empty-illustration::before {
  width: 18px;
  height: 76px;
  left: 44px;
  top: 34px;
  box-shadow: 26px 8px 0 0 rgba(255, 255, 255, 0.9), 52px 14px 0 0 rgba(255, 255, 255, 0.82);
}

.empty-illustration::after {
  width: 42px;
  height: 62px;
  right: 34px;
  top: 40px;
  clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%);
}

.alert {
  color: #b5483b;
  background: #fff0ee;
  border: 1px solid #ffd6d0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px 16px;
}

@media (max-width: 980px) {
  .workspace-topbar {
    padding: 0 18px;
  }

  .notice-bar,
  .workspace-main {
    margin-left: 18px;
    margin-right: 18px;
    padding-left: 0;
    padding-right: 0;
  }

  .workspace-main {
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .completed-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    gap: 12px;
    overflow-x: auto;
  }

  .sidebar-brand,
  .sidebar-footer {
    width: auto;
    border: 0;
    padding: 0;
  }

  .sidebar-nav {
    display: flex;
    flex: 1;
    padding: 0;
  }

  .side-link {
    min-width: 92px;
  }

  .workspace-topbar {
    min-height: auto;
    padding: 12px 16px 0;
    flex-direction: column;
    align-items: stretch;
  }

  .top-tabs {
    gap: 24px;
  }

  .notice-bar {
    margin: 14px 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-main {
    padding: 16px;
  }

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

  .two-col,
  .three-lite-col,
  .batch-summary,
  .product-grid,
  .task-card-stats,
  .compact-public-grid,
  .task-filter-grid,
  .ledger-filter-grid {
    grid-template-columns: 1fr;
  }

  .compact-span-3,
  .compact-span-5 {
    grid-column: auto;
  }

  .completed-detail-grid,
  .order-detail-summary-grid,
  .order-screenshot-pair {
    grid-template-columns: 1fr;
  }

  .completed-detail-grid > .meta-span-two,
  .completed-detail-grid > .meta-span-three {
    grid-column: auto;
  }

  .compact-submit {
    width: 100%;
  }

  .inline-actions button,
  .product-card-head .remove-product {
    width: 100%;
    min-width: 0;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .quick-link,
  .filter-actions button {
    width: 100%;
    min-width: 0;
    text-align: center;
  }
}
