:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --panel: #f4f2ee;
  --panel-soft: #f7f5f1;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --ink: #0b1426;
  --ink-soft: #475569;
  --dim: #94a3b8;
  --brand: #1a3aff;
  --brand-soft: rgba(26, 58, 255, 0.06);
  --yellow: #f5c542;
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.1);
  --hot: #e0316d;
  --hot-soft: rgba(224, 49, 109, 0.12);
  --amber-soft: rgba(245, 197, 66, 0.18);
  --amber-text: #a16207;
  --row-h: 72px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

a {
  color: inherit;
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.app--watcher {
  grid-template-columns: minmax(0, 1fr);
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.brand {
  padding: 8px 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ink);
  flex: 0 0 32px;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink);
}

.nav a.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 0 var(--line), 0 6px 14px rgba(15, 23, 42, 0.04);
  font-weight: 600;
}

.nav .icon {
  width: 18px;
  display: inline-grid;
  place-items: center;
}

.side-logout {
  margin-top: auto;
  padding: 10px 8px 4px;
}

.header-logout {
  margin: 0;
  flex: 0 0 auto;
}

.button-plain {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 8px 4px;
}

.button-plain:hover {
  color: var(--ink);
}

.main {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.pagehead {
  padding: 28px 32px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

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

h1 {
  font-size: 28px;
  letter-spacing: -0.025em;
  margin-bottom: 0;
  font-weight: 800;
}

.sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.page-flash {
  padding: 0 32px;
}

.page-flash:empty {
  display: none;
}

.page-flash--account {
  padding: 0;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 600;
}

.flash--notice {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.18);
}

.flash--error {
  background: var(--hot-soft);
  color: var(--hot);
  border-color: rgba(224, 49, 109, 0.22);
}

.filters {
  padding: 0 32px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
}

.search-icon,
.clear-search {
  color: var(--dim);
  text-decoration: none;
}

.select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.select .label {
  color: var(--ink-soft);
  font-weight: 500;
}

.select--field select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  outline: 0;
  padding: 0;
}

.refresh-btn,
.export-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  min-height: 39px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.refresh-btn:hover:not(:disabled),
.export-btn:hover:not(:disabled) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.refresh-btn:disabled {
  color: var(--ink-soft);
  cursor: wait;
}

.export-btn:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
}

.export-btn:disabled[data-original-label] {
  cursor: wait;
}

.refresh-btn.is-refreshing span:first-child {
  animation: refresh-spin 0.8s linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.table-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
}

.table-scroll {
  overflow: auto;
  padding: 0 32px 24px;
}

.table-card {
  min-width: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
}

.table-card--watcher {
  min-width: 980px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead {
  background: var(--panel-soft);
}

th {
  text-align: left;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  height: var(--row-h);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover:not(.selected) {
  background: var(--panel-soft);
}

tr.selected {
  background: var(--brand-soft);
}

tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.customer-col {
  width: 300px;
}

.status-col {
  width: 140px;
}

.account-col {
  width: 230px;
}

.hot-col {
  width: 80px;
  text-align: center;
}

.online-sales-col {
  width: 120px;
}

.date-col {
  width: 170px;
}

.row-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  width: 100%;
}

.row-thumb {
  width: 56px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  object-fit: cover;
  background: linear-gradient(135deg, #c4663d, #8b3a2a);
  border: 1px solid var(--line);
  flex: 0 0 56px;
}

.row-thumb--empty {
  display: block;
  position: relative;
}

.row-thumb--empty::after,
.detail-thumb--empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0, 0, 0, 0.1) 8px 9px);
}

.thumb-2 {
  background: linear-gradient(135deg, #6e5b4a, #8a7355);
}

.thumb-3 {
  background: linear-gradient(135deg, #a3502c, #c97c46);
}

.thumb-4 {
  background: linear-gradient(135deg, #4a3a2e, #6b5440);
}

.thumb-5 {
  background: linear-gradient(135deg, #b06434, #d68a4a);
}

.thumb-6 {
  background: linear-gradient(135deg, #5e3a26, #7c5236);
}

.thumb-7 {
  background: linear-gradient(135deg, #9a4a2c, #be6738);
}

.thumb-8 {
  background: linear-gradient(135deg, #7a4630, #a3603e);
}

.thumb-9 {
  background: linear-gradient(135deg, #5c4632, #826046);
}

.thumb-10 {
  background: linear-gradient(135deg, #b06434, #c4663d);
}

.cust-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cust-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cust-email {
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-label {
  display: inline-block;
  max-width: 180px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-sales-cell {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.delivered {
  color: var(--green);
  background: var(--green-soft);
}

.pill.pending {
  color: var(--amber-text);
  background: var(--amber-soft);
}

.pill.waiting-for-edit,
.pill.waiting-for-render {
  color: var(--amber-text);
  background: var(--amber-soft);
}

.pill.locked {
  color: var(--brand);
  background: var(--brand-soft);
}

.pill.blocked {
  color: var(--ink-soft);
  background: var(--panel);
}

.hot-cell {
  text-align: center;
  font-size: 18px;
}

.empty-mark {
  color: var(--dim);
}

.date-cell {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-soft);
}

.empty-state {
  padding: 36px 18px;
  color: var(--ink-soft);
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  margin-bottom: 4px;
}

.detail {
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  padding: 28px 28px 32px;
}

.detail--empty {
  color: var(--ink-soft);
}

.detail--empty h2 {
  color: var(--ink);
}

.detail-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #c4663d 0%, #8b3a2a 70%);
  border: 1px solid var(--line);
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.d-head {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.d-name {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
}

.d-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.d-account {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.view-btn,
.hot-btn-secondary,
.save-btn,
.btn-primary,
.btn-ghost {
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.view-btn {
  width: 100%;
  margin-top: 18px;
  background: var(--brand);
  color: #ffffff;
  border: 0;
  padding: 13px 16px;
  box-shadow: 0 6px 18px rgba(26, 58, 255, 0.28), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.view-btn--disabled {
  background: var(--panel);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: default;
}

.hot-btn-secondary {
  width: 100%;
  margin-top: 8px;
  background: var(--surface);
  color: var(--hot);
  border: 1px solid rgba(224, 49, 109, 0.3);
  padding: 11px 16px;
}

.hot-btn-secondary:hover {
  background: var(--hot-soft);
}

.d-section {
  margin-top: 26px;
}

.d-section h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}

.field > span:first-child {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}

.field-hint,
.hint,
.desc {
  font-size: 12px;
  color: var(--ink-soft);
}

.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  outline: 0;
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input[readonly] {
  background: var(--panel-soft);
}

.save-btn {
  background: var(--ink);
  color: #ffffff;
  border: 0;
  padding: 10px 16px;
  margin-top: 4px;
}

.action-list {
  display: flex;
  flex-direction: column;
}

.action-list form {
  margin: 0;
}

.action-list button {
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 14px 4px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-list form:last-child button {
  border-bottom: 1px solid var(--line);
}

.action-list button:hover {
  color: var(--brand);
}

.action-list button.button--complete {
  color: var(--brand);
  background: var(--brand-soft);
}

.action-list button.danger:hover {
  color: var(--hot);
}

.action-list .ico {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--panel-soft);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--ink);
  flex: 0 0 32px;
}

.action-list button:hover .ico {
  background: var(--brand-soft);
  color: var(--brand);
}

.action-list button.button--complete .ico {
  background: var(--brand);
  color: #ffffff;
}

.action-list button.danger:hover .ico {
  background: var(--hot-soft);
  color: var(--hot);
}

.action-list .chev {
  margin-left: auto;
  color: var(--dim);
  font-size: 16px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.pagination__page {
  color: var(--ink-soft);
  font-weight: 700;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  padding: 9px 14px;
  border: 1px solid var(--line);
  font-size: 13px;
}

.btn-ghost.disabled {
  color: var(--dim);
  background: var(--panel-soft);
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border: 0;
  padding: 9px 18px;
  box-shadow: 0 6px 16px rgba(26, 58, 255, 0.28), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.btn-primary[disabled] {
  background: var(--panel);
  color: var(--ink-soft);
  cursor: not-allowed;
  box-shadow: none;
}

.report-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.report-dialog::backdrop {
  background: rgba(11, 20, 38, 0.38);
}

.report-form {
  margin: 0;
}

.report-dialog__head,
.report-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.report-dialog__head {
  border-bottom: 1px solid var(--line);
}

.report-dialog__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.report-dialog__body {
  padding: 18px;
}

.report-dialog__foot {
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}

.dialog-close {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.report-error {
  min-height: 18px;
  color: var(--hot);
  font-size: 12px;
  font-weight: 700;
}

.report-error:empty {
  display: none;
}

.main--account {
  overflow-y: auto;
  padding: 28px 0 48px;
}

.account-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
}

.account-head {
  margin-bottom: 22px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 0 var(--line);
  margin-bottom: 16px;
}

.settings-card__head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-card__head h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.settings-card__head .desc {
  margin-top: 4px;
}

.settings-card__body {
  padding: 22px 24px;
}

.settings-card__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 0 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.reqs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border-radius: 8px;
}

.req {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.tick {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 9px;
  color: transparent;
}

.req.ok {
  color: var(--green);
}

.req.ok .tick {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.shell {
  width: min(460px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 32px 0;
}

.brand-lockup--auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo--auth-page {
  width: 168px;
  height: auto;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
}

.panel--auth {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
  padding: 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button--primary {
  background: var(--brand);
  color: #ffffff;
}

.button--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.button--secondary:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.forgot-password {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.forgot-password summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  text-align: center;
}

.forgot-password summary::-webkit-details-marker {
  display: none;
}

.forgot-password__form {
  margin-top: 14px;
}

@media (max-width: 1120px) {
  .table-wrap {
    grid-template-columns: 1fr;
  }

  .detail {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
  }

  .side-logout {
    margin-top: 12px;
  }

  .pagehead,
  .filters,
  .page-flash,
  .table-scroll {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filters,
  .form-row,
  .settings-card__foot {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }

  .detail {
    padding: 22px 16px 28px;
  }

  .account-container {
    padding: 0 16px;
  }
}
