:root {
  color-scheme: light;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #eef3ef;
  color: #12251a;
  --ink: #12251a;
  --muted: #5d7065;
  --line: #d7e5db;
  --soft: #f7faf8;
  --panel: #ffffff;
  --green: #237447;
  --green-soft: #dff4e7;
  --nav: #10261a;
  --loss: #b33939;
  --profit: #147a43;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background:
    linear-gradient(180deg, rgba(221, 238, 226, 0.92), rgba(247, 250, 248, 0.98) 340px),
    repeating-linear-gradient(90deg, rgba(22, 68, 42, 0.05) 0 1px, transparent 1px 80px),
    #f7faf8;
}

body.employee-embed-mode {
  background: transparent;
  min-width: 0;
  --ink: #3b2d12;
  --muted: #7b6840;
  --line: #f1e4b6;
  --soft: #fffaf0;
  --panel: #fffdf7;
  --green: #f0b429;
  --green-soft: #fff2c6;
  --nav: #fff7de;
  --loss: #c2410c;
  --profit: #15803d;
}

button,
input,
textarea,
select,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.eyebrow {
  color: #338154;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.login-view {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr) 420px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 52px 28px;
}

.login-home-mode {
  background: #ffffff;
  display: flex;
  justify-content: center;
  max-width: none;
}

.login-entry button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 850;
  min-height: 42px;
  min-width: 112px;
  padding: 0 18px;
}

.login-entry {
  align-items: center;
  display: grid;
  gap: 24px;
  justify-items: center;
}

.login-entry h1 {
  color: var(--ink);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.login-copy h1 {
  color: var(--ink);
  font-size: 72px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.98;
}

.login-copy p:last-child {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin-top: 18px;
  max-width: 680px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(20, 74, 45, 0.12);
  display: grid;
  gap: 16px;
  padding: 24px;
}

.login-panel label,
.import-form label,
.employee-form label {
  display: grid;
  gap: 7px;
}

.login-panel span,
.import-form span,
.custom-order-form span,
.employee-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-panel input,
.import-form input,
.import-form select,
.custom-order-form input,
.employee-form input,
.employee-form select,
.order-table input,
.order-table select,
.order-table textarea {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  outline: none;
}

.login-panel input,
.import-form input,
.import-form select,
.custom-order-form input,
.employee-form input,
.employee-form select {
  min-height: 32px;
  padding: 0 9px;
}

.login-panel input:focus,
.import-form input:focus,
.import-form select:focus,
.custom-order-form input:focus,
.employee-form input:focus,
.employee-form select:focus,
.order-table input:focus,
.order-table select:focus,
.order-table textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.12);
}

.datetime-native-hidden {
  display: none !important;
}

.datetime-combo {
  align-items: center;
  display: grid;
  gap: 3px;
  grid-template-columns: minmax(104px, 1fr) repeat(3, 42px);
  min-width: 0;
  width: 100%;
}

.datetime-combo-date,
.datetime-combo-select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  height: 32px;
  min-width: 0;
  outline: none;
  padding: 0 5px;
  width: 100%;
}

.datetime-combo-date:focus,
.datetime-combo-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.12);
}

.login-panel button,
.import-form button,
.custom-order-form button,
.employee-form button,
.save-button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 850;
  min-height: 32px;
  padding: 0 12px;
}

.form-message {
  color: var(--loss);
  font-size: 13px;
  min-height: 18px;
}

.inline-message {
  margin-top: 10px;
}

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

.employee-embed-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
}

.employee-embed-mode .content {
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 0.98), rgba(255, 253, 247, 0.98)),
    #fffdf7;
}

.sidebar-collapsed .workspace {
  grid-template-columns: 52px minmax(0, 1fr);
}

.sidebar {
  background: rgba(249, 253, 250, 0.96);
  border: 1px solid #cfe3d6;
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(20, 74, 45, 0.12);
  color: #163324;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 6px 0 6px 6px;
  min-height: calc(100vh - 12px);
  padding: 10px;
  position: sticky;
  top: 6px;
  transition: width 0.2s ease, padding 0.2s ease;
}

.employee-embed-mode .sidebar,
.employee-embed-mode .sub-tabs {
  display: none !important;
}

.employee-embed-mode .content-head,
.employee-embed-mode .data-band,
.employee-embed-mode .upload-band,
.employee-embed-mode .metric-grid > div,
.employee-embed-mode .overview-metric-grid > article,
.employee-embed-mode .section-title,
.employee-embed-mode .table-wrap,
.employee-embed-mode .group-board-card,
.employee-embed-mode .employee-card,
.employee-embed-mode .group-watch-card,
.employee-embed-mode .watch-group-row {
  background: rgba(255, 253, 247, 0.96);
  border-color: #f1e4b6;
  box-shadow: 0 14px 34px rgba(123, 97, 24, 0.08);
}

.employee-embed-mode .eyebrow,
.employee-embed-mode .section-title span,
.employee-embed-mode .content-head span,
.employee-embed-mode .employee-name,
.employee-embed-mode .pager,
.employee-embed-mode .form-message {
  color: #8a6b17;
}

.employee-embed-mode .content-head h1,
.employee-embed-mode .section-title h2,
.employee-embed-mode .group-board-card h3,
.employee-embed-mode .metric-grid strong,
.employee-embed-mode .overview-metric-grid strong {
  color: #4f3b07;
}

.employee-embed-mode button:not(.danger-outline-button):not(.danger-button):not(.ghost-button),
.employee-embed-mode .save-button,
.employee-embed-mode .save-all-button,
.employee-embed-mode .title-badge.is-active {
  background: #f0b429;
  color: #3b2d12;
}

.employee-embed-mode .ghost-button,
.employee-embed-mode .secondary-button,
.employee-embed-mode .title-badge,
.employee-embed-mode .sub-tabs button,
.employee-embed-mode .module-nav button {
  background: #fff9e8;
  border-color: #ecdba3;
  color: #7b6840;
}

.employee-embed-mode .sub-tabs button.is-active,
.employee-embed-mode .module-nav button.is-active {
  background: #ffe7a3;
  border-color: #f0b429;
  color: #4f3b07;
}

.sidebar-toggle {
  background: #edf7f0;
  border: 1px solid #cfe3d6;
  border-radius: 6px;
  color: #24553a;
  font-size: 11px;
  font-weight: 850;
  min-height: 28px;
}

.sidebar-collapsed .sidebar {
  align-items: center;
  gap: 10px;
  margin: 6px 0 6px 6px;
  padding: 8px 6px;
}

.sidebar-collapsed .sidebar h2,
.sidebar-collapsed .sidebar .eyebrow,
.sidebar-collapsed .employee-name,
.sidebar-collapsed .module-nav button,
.sidebar-collapsed #logoutButton {
  writing-mode: vertical-rl;
}

.sidebar-collapsed .module-nav button {
  min-height: 92px;
  padding: 8px 4px;
  text-align: center;
}

.sidebar h2 {
  font-size: 22px;
  line-height: 1.1;
}

.employee-name {
  color: #4f6d5b;
  font-size: 12px;
  font-weight: 750;
  margin-top: 5px;
}

.module-nav {
  background: #ffffff;
  border: 1px solid #d8eadc;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
  padding: 5px;
}

.module-nav button,
.ghost-button {
  border-radius: 6px;
  font-weight: 850;
}

.module-nav button {
  background: #f7fbf8;
  border: 1px solid #d8eadc;
  color: #183b29;
  font-size: 12px;
  line-height: 1.2;
  min-height: 32px;
  padding: 0 9px;
  text-align: left;
}

.module-nav button.is-active {
  background: #dff4e7;
  border-color: #237447;
  box-shadow: 0 0 0 2px rgba(35, 116, 71, 0.1);
  color: #10261a;
}

.module-nav button:hover {
  background: #eef8f1;
  border-color: #bfe1cb;
}

.ghost-button {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  min-height: 30px;
  padding: 0 10px;
}

.sidebar .ghost-button {
  color: #24553a;
  margin-top: auto;
}

.content {
  min-width: 0;
  padding: 18px 16px;
}

.employee-embed-mode .content {
  padding: 0;
}

.content-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.content-head h1 {
  color: var(--ink);
  font-size: 42px;
  line-height: 1.05;
}

.head-actions {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
}

.head-actions .ghost-button {
  color: var(--green);
}

.sub-tabs {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.mini-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-tabs button,
.range-buttons button {
  background: #eef6f1;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 14px;
}

.mini-tabs button.is-active,
.range-buttons button.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.board-toolbar {
  align-items: center;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px;
}

.board-toolbar span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.range-buttons {
  display: flex;
  gap: 8px;
}

.sub-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  min-height: 28px;
  padding: 0 10px;
}

.sub-tabs button.is-active {
  background: var(--green);
  color: #ffffff;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.finance-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.business-data-section {
  margin-bottom: 16px;
}

.business-data-title {
  grid-template-columns: minmax(0, 1fr);
}

.business-data-title-left {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#businessDataCards {
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}

#businessDataCards .business-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
  border-color: var(--line);
  box-shadow: none;
  min-height: 150px;
  padding: 12px;
}

#businessDataCards .business-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

#businessDataCards .business-card > strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
  margin-top: 10px;
}

#businessDataCards .business-card > strong.is-loss {
  color: #b42318;
}

.business-card-lines {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.business-card-lines div {
  align-items: center;
  background: #eef8f1;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
  padding: 0 8px;
}

.business-card-lines span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.business-card-lines b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.business-card-lines b.is-loss {
  color: #b42318;
}

.business-store-data-section {
  margin-bottom: 16px;
}

.business-store-data-title {
  align-items: flex-start;
  gap: 12px;
}

.business-store-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.business-store-period-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.business-store-period-tabs button {
  background: #edf7f1;
  border-color: #bfdcc9;
  color: #153b2a;
  font-weight: 750;
}

.business-store-period-tabs button.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.segmented-control.business-store-period-tabs button.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.business-store-period-tabs button:focus-visible {
  outline: 2px solid #8ec8a5;
  outline-offset: 2px;
}

.business-store-month {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 36px;
}

.business-store-month input {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  min-height: 36px;
  padding: 0 10px;
}

.business-store-month input:disabled {
  opacity: 0.45;
}

.business-store-table {
  min-width: 1360px;
}

.business-store-table th,
.business-store-table td {
  white-space: nowrap;
}

.business-store-table th:first-child,
.business-store-table td:first-child {
  background: #e6f3eb;
  left: 0;
  min-width: 156px;
  position: sticky;
  z-index: 3;
}

.business-store-table td:first-child {
  background: #ffffff;
  font-weight: 900;
}

.business-store-value.is-negative {
  color: #b42318;
  font-weight: 900;
}

.overview-metric-grid {
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.overview-metric-grid .overview-card {
  min-height: 136px;
  padding: 12px;
}

.overview-metric-grid strong {
  font-size: 25px;
}

.product-analysis-cards {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.ai-recommendation-summary {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.metric-grid article,
.data-band,
.upload-band,
.placeholder-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 48px rgba(23, 84, 48, 0.08);
}

.metric-grid article {
  min-height: 118px;
  padding: 16px;
}

.ai-recommendation-panel {
  min-width: 0;
}

.ai-recommendation-head {
  align-items: center;
}

.ai-version-actions {
  align-items: center;
}

.ai-recommendation-status {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.front-weight-config {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 48px rgba(23, 84, 48, 0.08);
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.front-weight-config > header {
  align-items: center;
  border-bottom: 1px solid #dcece3;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.front-weight-config h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 0;
}

.front-weight-config p,
.front-weight-config header span,
.front-weight-overview span,
.front-weight-row small,
.front-weight-slider small,
.front-weight-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.front-weight-overview {
  border: 1px solid #dcece3;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.front-weight-overview div {
  border-right: 1px solid #dcece3;
  padding: 10px;
}

.front-weight-overview div:last-child {
  border-right: 0;
}

.front-weight-overview strong {
  color: var(--ink);
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.front-weight-grid,
.front-weight-controls {
  display: grid;
  gap: 10px;
}

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

.front-weight-row,
.front-weight-slider {
  align-items: center;
  background: #f5faf7;
  border: 1px solid #dcece3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.front-weight-row {
  grid-template-columns: minmax(0, 1fr) 112px auto;
}

.front-weight-row span,
.front-weight-slider span {
  display: grid;
  gap: 4px;
}

.front-weight-row strong,
.front-weight-slider strong,
.front-weight-group h3 {
  color: var(--ink);
  font-size: 13px;
}

.front-weight-row small[data-fashionrep-weight-badge],
.front-weight-slider em[data-fashionrep-weight-badge] {
  background: #ffffff;
  border: 1px solid #cde5d6;
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  justify-self: start;
  padding: 2px 7px;
}

.front-weight-row.is-custom small[data-fashionrep-weight-badge],
.front-weight-slider.is-custom em[data-fashionrep-weight-badge] {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

.front-weight-row input[type="number"],
.front-weight-slider input[type="number"] {
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  min-width: 0;
  padding: 8px 10px;
}

.front-weight-toggle input {
  height: 18px;
  width: 18px;
}

.front-weight-group {
  border-top: 1px solid #dcece3;
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.front-weight-group h3 {
  margin: 0;
}

.front-weight-slider {
  grid-template-columns: minmax(0, 1fr) 110px 72px auto;
}

.front-weight-slider input[type="range"] {
  accent-color: var(--green);
  width: 100%;
}

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

.front-weight-reset {
  min-height: 32px;
  padding: 0 10px;
}

.ai-recommendation-board {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.ai-recommendation-group-column {
  display: grid;
  gap: 10px;
}

.ai-recommendation-group-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.ai-recommendation-groups,
.ai-recommendation-detail {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 48px rgba(23, 84, 48, 0.08);
}

.ai-recommendation-groups {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 10px;
  position: sticky;
  top: 18px;
}

.ai-recommendation-groups button {
  background: #f5faf7;
  border: 1px solid #dcece3;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
  text-align: left;
}

.ai-recommendation-groups button.is-active {
  background: var(--green-soft);
  border-color: var(--green);
}

.ai-recommendation-groups strong,
.ai-recommendation-detail h2,
.ai-recommendation-product h3 {
  color: var(--ink);
}

.ai-recommendation-groups span,
.ai-recommendation-groups small,
.ai-recommendation-detail p,
.ai-recommendation-product p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.ai-recommendation-detail {
  padding: 16px;
}

.ai-recommendation-detail > header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ai-recommendation-detail > header h2 {
  font-size: 24px;
  line-height: 1.2;
}

.ai-recommendation-detail > header > strong,
.ai-recommendation-product > em {
  background: var(--green-soft);
  border: 1px solid #bfe3cd;
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  padding: 6px 10px;
  white-space: nowrap;
}

.ai-recommendation-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ai-recommendation-forward-tools {
  background: #f5faf7;
  border: 1px solid #dcece3;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

.ai-recommendation-forward-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.ai-recommendation-forward-row label {
  display: grid;
  gap: 6px;
}

.ai-recommendation-forward-row input {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 12px;
}

.ai-recommendation-forward-status {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-top: 8px;
  min-height: 18px;
}

.ai-recommendation-metrics div,
.ai-recommendation-reason {
  background: #f5faf7;
  border: 1px solid #dcece3;
  border-radius: 8px;
  padding: 10px;
}

.ai-recommendation-metrics span,
.ai-recommendation-reason span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 5px;
}

.ai-recommendation-metrics strong,
.ai-recommendation-reason strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.ai-recommendation-reason small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
}

.ai-recommendation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.ai-recommendation-tags span {
  background: #edf6f1;
  border: 1px solid #d4e9dc;
  border-radius: 999px;
  color: #326b48;
  font-size: 12px;
  font-weight: 850;
  padding: 4px 8px;
}

.ai-recommendation-products {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ai-recommendation-product {
  align-items: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 26px 34px minmax(0, 1fr) auto;
  padding: 12px;
}

.ai-recommendation-select {
  align-items: center;
  display: inline-flex;
  height: 28px;
  justify-content: center;
}

.ai-recommendation-select input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.ai-recommendation-product > strong {
  align-items: center;
  background: var(--green);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 13px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.ai-recommendation-product h3 {
  font-size: 16px;
  line-height: 1.35;
}

.ai-recommendation-product a {
  color: var(--green);
  text-decoration: none;
}

.ai-recommendation-product-actions {
  align-items: end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.overview-card {
  min-height: 152px;
}

.metric-grid .metric-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
}

.metric-grid strong {
  color: var(--ink);
  display: block;
  font-size: 29px;
  line-height: 1.05;
  margin-top: 13px;
}

.metric-grid em {
  color: #338154;
  display: block;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  margin-top: 6px;
}

.metric-breakdown {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.metric-breakdown small {
  align-items: center;
  background: #f3f8f5;
  border: 1px solid #dcece3;
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
  padding: 6px 8px;
}

.metric-breakdown b {
  color: var(--ink);
  font-size: 13px;
}

.metric-detail-list {
  border-top: 1px dashed rgba(88, 112, 94, 0.28);
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
}

.metric-detail-list small {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.metric-detail-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metric-detail-list b {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.growth-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.growth-pill.is-up {
  background: #e3f5e9;
  color: var(--green);
}

.growth-pill.is-down {
  background: #fff1ed;
  color: var(--loss);
}

.growth-pill.is-flat {
  background: #eef3ef;
  color: var(--muted);
}

.data-band,
.upload-band {
  margin-bottom: 10px;
  padding: 10px;
}

.section-title {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.page-size-label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 6px;
}

.page-size-label select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 32px;
  padding: 0 8px;
}

.person-income-section {
  margin-top: 16px;
}

.person-income-title {
  align-items: flex-start;
  gap: 12px;
}

.person-income-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.person-income-month {
  align-items: center;
  display: flex;
  gap: 6px;
}

.person-income-month span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.person-income-month input {
  background: #fff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 36px;
  padding: 0 10px;
}

.person-income-people-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.person-income-people-filter label {
  align-items: center;
  background: #f3faf5;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
}

.person-income-rows {
  display: grid;
  gap: 10px;
}

.person-income-board {
  display: grid;
  gap: 10px;
  grid-template-columns: 104px minmax(0, 1fr);
  overflow: hidden;
}

.person-income-date-column {
  display: grid;
  grid-auto-rows: 58px;
  grid-template-rows: 78px;
}

.person-income-date-head,
.person-income-date-cell {
  align-items: center;
  background: #eef7f1;
  border: 1px solid var(--line);
  color: var(--green);
  display: flex;
  font-weight: 900;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.person-income-date-head {
  border-radius: 8px 8px 0 0;
  font-size: 13px;
}

.person-income-date-cell {
  border-top: 0;
  font-size: 18px;
  line-height: 1.15;
}

.person-income-date-cell:last-child {
  border-radius: 0 0 8px 8px;
}

.person-income-person-columns {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.person-income-card {
  background: #f7fcf8;
  border: 1px solid #d5ebdc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  flex: 0 0 292px;
  overflow: hidden;
}

.person-income-card-head {
  display: grid;
  flex: 0 0 78px;
  grid-template-rows: 38px 40px;
}

.person-income-card h3 {
  align-self: end;
  color: var(--green);
  font-size: 16px;
  margin: 0;
  padding: 0 12px 4px;
  text-align: center;
}

.person-income-metrics {
  align-self: end;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px 10px;
}

.person-income-metrics b,
.person-income-value-row span {
  min-width: 0;
  text-align: center;
}

.person-income-metrics b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.person-income-value-list {
  display: grid;
  grid-auto-rows: 58px;
}

.person-income-value-row {
  align-items: center;
  border-top: 1px solid #dbeee1;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px;
}

.person-income-value-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.order-filter-form {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: 168px 168px 140px 140px minmax(240px, 1fr) 104px;
  margin-bottom: 8px;
}

.order-filter-form label {
  display: grid;
  gap: 4px;
}

.order-filter-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.order-filter-form input,
.order-filter-form select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 32px;
  outline: none;
  padding: 0 8px;
  width: 100%;
}

.order-filter-form input:focus,
.order-filter-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.12);
}

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

.finance-title-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.save-all-button {
  background: #10261a;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 0 12px;
}

.save-all-button:disabled {
  background: #8ea69a;
  cursor: wait;
}

.danger-outline-button {
  background: #fff7f4;
  border: 1px solid #ffc8ba;
  border-radius: 6px;
  color: var(--loss);
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 0 12px;
}

.danger-outline-button:disabled {
  color: #a9948f;
  cursor: wait;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.table-scroll-bar {
  background: #f6fbf8;
  border: 1px solid var(--line);
  cursor: grab;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.table-scroll-bar-bottom {
  border-top: 0;
  border-radius: 0 0 8px 8px;
  bottom: 0;
  box-shadow: 0 -8px 18px rgba(36, 91, 70, 0.12);
  margin-top: -1px;
  position: sticky;
  z-index: 40;
}

.table-scroll-bar.is-dragging {
  cursor: grabbing;
}

.table-scroll-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.order-table-wrap {
  border-radius: 8px 8px 0 0;
}

.order-table-wrap::-webkit-scrollbar {
  height: 0;
}

.table-scroll-spacer {
  height: 1px;
  min-width: 100%;
}

.group-overview-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.group-overview-table {
  min-width: 3260px;
}

.group-overview-table th,
.group-overview-table td {
  white-space: nowrap;
}

.group-overview-table .group-note-editor {
  min-width: 260px;
}

.group-time-cell {
  min-width: 150px;
}

.time-stack {
  display: grid;
  gap: 4px;
  line-height: 1.35;
}

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

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

th {
  background: #e6f3eb;
  color: #19452c;
  font-size: 12px;
  font-weight: 850;
  position: sticky;
  top: 0;
  z-index: 2;
}

td {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

td strong {
  display: block;
  font-size: 13px;
}

.muted {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.order-table {
  min-width: 2260px;
  table-layout: auto;
}

.product-analysis-wrap {
  max-width: 100%;
}

.front-analysis-controls {
  display: grid;
  gap: 10px;
}

.front-analysis-controls .order-filter-form {
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(140px, 0.75fr) minmax(140px, 0.75fr) minmax(220px, 1.25fr) auto auto;
  margin-bottom: 0;
  padding-bottom: 10px;
}

.front-analysis-controls .order-filter-form:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.front-forward-form {
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(260px, 1.3fr) auto auto minmax(150px, 0.7fr);
}

.front-forward-form > span {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.front-product-advice {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.front-product-pager label {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.front-product-pager input,
.front-product-pager select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  height: 30px;
  padding: 0 8px;
  width: 74px;
}

.front-product-analysis-table {
  min-width: 1360px;
}

.forward-panel,
.detail-forward-bar {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}

.forward-panel label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.forward-panel input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 34px;
  min-width: 260px;
  padding: 0 10px;
}

.forward-panel span,
.detail-forward-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.front-product-analysis-table th,
.front-product-analysis-table td {
  white-space: nowrap;
}

.sort-head {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  gap: 5px;
  padding: 0;
}

.sort-head::after {
  color: #6f8177;
  content: "↕";
  font-size: 12px;
}

.sort-head[data-sort-direction="asc"]::after {
  color: var(--green);
  content: "↑";
}

.sort-head[data-sort-direction="desc"]::after {
  color: var(--green);
  content: "↓";
}

.front-product-analysis-table th:nth-child(2),
.front-product-analysis-table td:nth-child(2) {
  min-width: 360px;
  white-space: normal;
}

.front-ai-truth-table {
  min-width: 1760px;
  table-layout: fixed;
}

.front-ai-truth-table th,
.front-ai-truth-table td {
  padding: 9px 8px;
  vertical-align: top;
}

.front-ai-truth-table th:nth-child(1),
.front-ai-truth-table td:nth-child(1) {
  width: 44px;
}

.front-ai-truth-table th:nth-child(2),
.front-ai-truth-table td:nth-child(2) {
  min-width: 0;
  width: 54px;
}

.front-ai-truth-table th:nth-child(3),
.front-ai-truth-table td:nth-child(3) {
  width: 58px;
}

.front-ai-truth-table th:nth-child(4),
.front-ai-truth-table td:nth-child(4) {
  padding-right: 14px;
  width: 166px;
}

.front-ai-truth-table th:nth-child(5),
.front-ai-truth-table td:nth-child(5) {
  width: 140px;
}

.front-ai-truth-table th:nth-child(6),
.front-ai-truth-table td:nth-child(6) {
  width: 78px;
}

.front-ai-truth-table th:nth-child(7),
.front-ai-truth-table td:nth-child(7) {
  width: 110px;
}

.front-ai-truth-table th:nth-child(8),
.front-ai-truth-table td:nth-child(8) {
  width: 280px;
}

.front-ai-truth-table th:nth-child(9),
.front-ai-truth-table td:nth-child(9) {
  width: 112px;
}

.front-ai-truth-table th:nth-child(10),
.front-ai-truth-table td:nth-child(10) {
  width: 86px;
}

.front-ai-truth-table th:nth-child(11),
.front-ai-truth-table td:nth-child(11) {
  width: 105px;
}

.front-ai-truth-table th:nth-child(12),
.front-ai-truth-table td:nth-child(12) {
  width: 120px;
}

.front-ai-truth-table th:nth-child(13),
.front-ai-truth-table td:nth-child(13) {
  width: 170px;
}

.front-ai-truth-table th:nth-child(14),
.front-ai-truth-table td:nth-child(14) {
  width: 150px;
}

.front-ai-truth-table th:nth-child(15),
.front-ai-truth-table td:nth-child(15) {
  width: 96px;
}

.front-ai-truth-table small {
  color: #667085;
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px;
}

.front-ai-truth-table td:nth-child(4) strong,
.front-ai-truth-table td:nth-child(7) {
  font-family: Consolas, "SFMono-Regular", monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

.front-ai-truth-table a {
  color: var(--green);
  font-weight: 800;
}

.front-ai-truth-record-section {
  display: grid;
  gap: 0;
}

.front-ai-truth-record-tools-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 12px;
}

.front-ai-truth-forward-inline,
.front-ai-truth-record-toolbar,
.front-ai-truth-pagination-inline,
.front-ai-truth-search-control,
.front-ai-truth-forward-inline label {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.front-ai-truth-forward-inline {
  flex: 1 1 760px;
}

.front-ai-truth-record-toolbar {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.front-ai-truth-forward-inline span,
.front-ai-truth-record-toolbar span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.front-ai-truth-forward-inline input,
.front-ai-truth-forward-inline select,
.front-ai-truth-record-toolbar input,
.front-ai-truth-record-toolbar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  height: 34px;
  padding: 0 10px;
}

.front-ai-truth-forward-inline input {
  min-width: 260px;
}

.front-ai-truth-search-control {
  flex: 1 1 420px;
  justify-content: flex-end;
  min-width: min(300px, 100%);
}

.front-ai-truth-search-box {
  align-items: center;
  display: flex;
  flex: 1 1 360px;
  max-width: 760px;
  min-width: 0;
  position: relative;
}

.front-ai-truth-forward-inline .front-ai-truth-search-box input {
  min-width: 0;
  padding-right: 36px;
  width: 100%;
}

.front-ai-truth-search-clear {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #667085;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-width: 28px;
  padding: 0;
  position: absolute;
  right: 4px;
  top: 3px;
  width: 28px;
}

.front-ai-truth-link-stack,
.front-ai-truth-item-stack,
.front-ai-truth-group-cell,
.front-ai-truth-time-cell,
.front-ai-truth-product-entry {
  display: grid;
  gap: 4px;
}

.front-ai-truth-product-info-stack,
.front-ai-truth-product-origin-stack {
  display: grid;
  gap: 8px;
}

.front-ai-truth-product-info-entry,
.front-ai-truth-product-origin-entry,
.front-ai-truth-link-stack .front-ai-truth-product-entry {
  min-height: 37px;
  min-width: 0;
}

.front-ai-truth-product-info-entry {
  display: grid;
  gap: 4px;
}

.front-ai-truth-product-info-line {
  align-items: start;
  display: grid;
  gap: 5px;
  grid-template-columns: 58px minmax(0, 1fr);
  min-width: 0;
}

.front-ai-truth-product-info-label {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}

.front-ai-truth-product-info-value {
  min-width: 0;
}

.front-ai-truth-product-info-link,
.front-ai-truth-product-post-link {
  color: var(--green);
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: underline;
}

.front-ai-truth-product-name-clamp {
  display: -webkit-box;
  max-height: 2.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.front-ai-truth-product-tag {
  background: #fff6e6;
  border: 1px solid #f6d79b;
  border-radius: 999px;
  color: #9a5b00;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 3px 7px;
  width: max-content;
}

.front-ai-truth-product-unmatched {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.front-ai-truth-forward-item {
  font-size: 11px;
  min-height: 21px;
  min-width: 40px;
  padding: 1px 5px;
}

.front-ai-truth-count-cell,
.front-ai-truth-heat-cell strong,
.front-ai-truth-time-cell strong {
  color: var(--text);
  font-size: 13px;
}

.front-ai-truth-heat-cell {
  display: grid;
  gap: 2px;
}

.front-ai-truth-heat-cell small {
  margin-top: 0;
}

.front-ai-truth-detail-button {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  justify-self: start;
  text-decoration: underline;
}

.front-ai-truth-row-actions {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
}

.front-ai-truth-detail,
.front-ai-truth-match,
.front-ai-truth-delete {
  background: transparent;
  border: 0;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  height: auto;
  padding: 0;
  text-decoration: underline;
}

.front-ai-truth-detail {
  color: var(--green);
}

.front-ai-truth-delete {
  color: #b91c1c;
}

.front-ai-truth-sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  gap: 4px;
  height: auto;
  padding: 0;
}

.front-ai-truth-sort-button.is-active,
.front-ai-truth-sort-button:hover {
  color: var(--green);
}

.front-ai-truth-sort-arrow {
  color: var(--green);
  font-size: 12px;
  line-height: 1;
}

.product-analysis-name {
  display: block;
  font-weight: 900;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-pill {
  background: #e6f3eb;
  border: 1px solid #cfe5d5;
  border-radius: 999px;
  color: #19452c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
}

.analysis-recommendation-tabs {
  margin-bottom: 14px;
}

.front-analysis-rec-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 260px auto 1fr;
}

.front-analysis-rec-toolbar label,
.analysis-rec-weight-form label {
  display: grid;
  gap: 6px;
}

.front-analysis-rec-toolbar span,
.analysis-rec-weight-form span {
  color: #5f6f65;
  font-size: 12px;
  font-weight: 700;
}

.front-analysis-rec-toolbar input,
.front-analysis-rec-toolbar select,
.analysis-rec-weight-form input,
.analysis-rec-weight-form select {
  border: 1px solid #d9b767;
  border-radius: 8px;
  height: 38px;
  padding: 0 10px;
}

.front-analysis-rec-toolbar > span {
  align-self: center;
  color: #6f5d39;
  font-size: 12px;
  font-weight: 600;
}

.front-analysis-rec-table-wrap {
  overflow-x: auto;
}

.front-analysis-rec-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.front-analysis-rec-table th,
.front-analysis-rec-table td {
  border-bottom: 1px solid #ead9a6;
  font-size: 12px;
  padding: 5px 8px;
  text-align: left;
  vertical-align: middle;
}

.front-analysis-rec-table th {
  background: #dff1e4;
  color: #073b2b;
  font-size: 11px;
  font-weight: 800;
}

.front-analysis-rec-table td strong {
  color: #083b2b;
}

.analysis-rec-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  font-weight: 800;
  line-height: 1.15;
  max-width: 320px;
  overflow: hidden;
}

.analysis-rec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-height: 36px;
  overflow: hidden;
}

.analysis-rec-tags span {
  border: 1px solid #8fd0cf;
  border-radius: 999px;
  color: #07535a;
  font-size: 10px;
  height: 16px;
  line-height: 14px;
  padding: 0 4px;
}

.analysis-rec-muted {
  color: #8a7d62;
  font-size: 11px;
}

.analysis-rec-weight-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 260px) repeat(3, minmax(130px, 1fr)) auto minmax(150px, 1fr);
}

.analysis-rec-weight-meta {
  color: #6f5d39;
  font-size: 12px;
  margin-top: 10px;
}

@media (max-width: 960px) {
  .front-analysis-rec-toolbar,
  .analysis-rec-weight-form {
    grid-template-columns: 1fr;
  }
}

.modal-backdrop {
  align-items: center;
  background: rgba(16, 38, 26, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 80;
}

.product-detail-modal {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 38, 26, 0.24);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  width: min(1040px, calc(100vw - 48px));
}

.store-allocation-modal,
.address-preview-modal {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 38, 26, 0.24);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  width: min(720px, calc(100vw - 48px));
}

.material-rule-modal {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 38, 26, 0.24);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  width: min(860px, calc(100vw - 48px));
}

.modal-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.modal-header h2 {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.modal-header span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 6px;
}

.modal-close {
  background: #e6f3eb;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  height: 36px;
  width: 36px;
}

.modal-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}

.detail-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.detail-summary-grid div {
  background: #f3f8f5;
  border: 1px solid #dcece3;
  border-radius: 8px;
  padding: 10px 12px;
}

.detail-summary-grid span,
.detail-summary-grid small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.detail-summary-grid strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  margin-top: 4px;
}

.detail-post-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-order-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.detail-post-head,
.detail-post-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 46px 150px 80px minmax(180px, 1fr) 76px 80px 92px;
  padding: 10px 12px;
}

.detail-post-head {
  background: #e6f3eb;
  color: #19452c;
  font-size: 12px;
  font-weight: 900;
}

.detail-post-row {
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.detail-post-row strong {
  font-variant-numeric: tabular-nums;
}

.detail-order-head,
.detail-order-row {
  grid-template-columns: 150px 160px 140px minmax(240px, 1fr);
}

.detail-sort-head {
  font-size: 12px;
}

.detail-filter-bar {
  align-items: center;
  background: #f3f8f5;
  border: 1px solid #dcece3;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 9px 12px;
}

.order-table th,
.order-table td {
  font-size: 12px;
  line-height: 1.25;
  padding: 4px 5px;
  white-space: nowrap;
}

.order-table th:nth-child(2),
.order-table td:nth-child(2) {
  min-width: 150px;
}

.order-table th:nth-child(3),
.order-table td:nth-child(3) {
  min-width: 380px;
  white-space: normal;
}

.order-table th:nth-child(4),
.order-table td:nth-child(4),
.order-table th:nth-child(5),
.order-table td:nth-child(5),
.order-table th:nth-child(6),
.order-table td:nth-child(6),
.order-table th:nth-child(7),
.order-table td:nth-child(7) {
  min-width: 150px;
}

.order-table th:nth-child(15),
.order-table td:nth-child(15) {
  min-width: 58px;
  text-align: center;
}

.order-table th:nth-child(16),
.order-table td:nth-child(16) {
  min-width: 58px;
}

.order-table th:nth-child(17),
.order-table td:nth-child(17) {
  min-width: 160px;
}

.order-table th:nth-child(18),
.order-table td:nth-child(18) {
  min-width: 104px;
}

.order-table input,
.order-table select,
.order-table textarea {
  min-height: 26px;
  min-width: 88px;
  padding: 3px 5px;
  width: 100%;
}

.order-table textarea {
  min-height: 34px;
  resize: vertical;
}

.money-input {
  max-width: 100px;
}

.title-badge {
  background: #fff5d8;
  border: 1px solid #f3d98a;
  border-radius: 999px;
  color: #8b5d00;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  margin-left: 6px;
  padding: 3px 8px;
  vertical-align: middle;
}

button.title-badge {
  cursor: pointer;
}

.title-badge.is-active {
  background: #10261a;
  border-color: #10261a;
  color: #ffffff;
}

.order-price-toggle {
  width: 48px;
}

.order-price-editor td {
  background: #f6faf7;
  border-top: 0;
}

.group-record-editor td {
  background: #f6faf7;
  border-top: 0;
}

.group-record-edit-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.group-record-edit-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.record-store-field {
  grid-column: span 2;
}

.group-admin-table {
  min-width: 1460px;
}

.group-record-edit-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.group-record-edit-grid input,
.group-record-edit-grid select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 36px;
  padding: 0 9px;
}

.inline-check-list {
  align-content: start;
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  max-height: 150px;
  min-width: 210px;
  overflow: auto;
  padding: 8px;
}

.inline-check-list label {
  align-items: center;
  display: flex;
  gap: 7px;
}

.inline-check-list input {
  min-height: auto;
  min-width: auto;
  width: auto;
}

.store-picker-shell {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.store-picker-shell > button,
.address-input-row button,
.address-panel-actions button {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 850;
  min-height: 38px;
  padding: 0 10px;
}

.store-picker-shell > button {
  text-align: left;
  width: 100%;
}

.picker-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.store-picker-data {
  display: none;
}

.store-allocation-modal-rows {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.store-allocation-modal-rows .store-allocation-row {
  border: 1px solid #dcece3;
  border-radius: 6px;
  padding: 8px;
}

.address-preview-modal-body {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.address-preview-modal-row {
  background: #f7faf8;
  border: 1px solid #dcece3;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  padding: 9px 10px;
  word-break: break-all;
}

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

.material-rule-grid label {
  display: grid;
  gap: 8px;
}

.material-rule-grid span,
.material-rule-source-box strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.material-rule-grid textarea {
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  min-height: 180px;
  padding: 10px;
  resize: vertical;
}

.material-rule-source-box {
  background: #f6faf7;
  border: 1px solid #dcece3;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
}

.material-source-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 150px;
  overflow: auto;
}

.material-source-options button {
  background: #ffffff;
  border: 1px solid #cfe7d5;
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  max-width: 220px;
  overflow: hidden;
  padding: 5px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-rule-button {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.material-rule-button span {
  color: var(--muted);
  font-size: 11px;
}

.scheduled-forward-controls {
  margin-bottom: 16px;
}

.scheduled-forward-control-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 320px) auto minmax(0, 1fr);
}

.scheduled-forward-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scheduled-forward-control-row label,
.scheduled-forward-form label {
  display: grid;
  gap: 7px;
}

.scheduled-forward-control-row label span,
.scheduled-forward-form label span,
.scheduled-forward-radio-group span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.scheduled-forward-control-row select,
.scheduled-forward-form input,
.scheduled-forward-form select,
.scheduled-forward-form textarea,
.scheduled-forward-table textarea {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  outline: none;
}

.scheduled-forward-control-row select,
.scheduled-forward-form input,
.scheduled-forward-form select {
  font-size: 13px;
  min-height: 36px;
  padding: 0 10px;
}

.scheduled-forward-form input[type="number"],
.scheduled-forward-form input[type="datetime-local"],
.scheduled-forward-form select {
  padding-right: 28px;
}

.scheduled-forward-form textarea,
.scheduled-forward-table textarea {
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
}

.scheduled-forward-control-row select:focus,
.scheduled-forward-form input:focus,
.scheduled-forward-form select:focus,
.scheduled-forward-form textarea:focus,
.scheduled-forward-table textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.12);
}

.scheduled-forward-control-row > button,
.scheduled-forward-create-actions > button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 850;
  min-height: 42px;
  padding: 0 16px;
}

.scheduled-forward-control-row > button:disabled,
.scheduled-forward-create-actions > button:disabled {
  background: #96ab9e;
  cursor: not-allowed;
}

.scheduled-forward-create-actions > .ghost-button {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
}

.scheduled-forward-account-summary {
  background: #f4f8f5;
  border: 1px solid #dcece3;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
}

.scheduled-forward-account-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.scheduled-forward-account-summary span,
.scheduled-forward-error {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scheduled-forward-table-wrap {
  max-width: 100%;
}

.scheduled-forward-table {
  min-width: 1540px;
}

.scheduled-forward-table th,
.scheduled-forward-table td {
  vertical-align: top;
}

.scheduled-forward-table td strong {
  color: var(--ink);
}

.scheduled-forward-table .muted {
  display: block;
  margin-top: 4px;
}

.scheduled-forward-table textarea {
  min-height: 64px;
  width: 240px;
}

.scheduled-forward-status {
  background: #eef6f1;
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  padding: 5px 10px;
}

.scheduled-forward-status.running,
.scheduled-forward-status.pausing {
  background: #fff5df;
  color: #9b6510;
}

.scheduled-forward-status.failed,
.scheduled-forward-status.no_material,
.scheduled-forward-status.insufficient_material {
  background: #fff0ed;
  color: var(--loss);
}

.scheduled-forward-status.archived,
.scheduled-forward-status.paused {
  background: #edf1ef;
  color: var(--muted);
}

.scheduled-forward-row-actions,
.scheduled-forward-action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.scheduled-forward-action-stack {
  min-width: 132px;
}

.scheduled-forward-table .ghost-button,
.scheduled-forward-action-stack .danger-outline-button {
  color: var(--green);
  min-height: 30px;
  padding: 0 10px;
}

.scheduled-forward-action-stack .danger-outline-button {
  color: var(--loss);
}

.scheduled-forward-error {
  display: block;
  line-height: 1.45;
  max-width: 240px;
}

.scheduled-forward-run-list {
  display: grid;
  gap: 10px;
}

.scheduled-forward-run-item {
  background: #f7faf8;
  border: 1px solid #dcece3;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.scheduled-forward-run-item header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.scheduled-forward-run-item span,
.scheduled-forward-run-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scheduled-forward-run-pager {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  justify-content: flex-end;
}

.scheduled-forward-modal {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 38, 26, 0.24);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  width: min(920px, calc(100vw - 48px));
}

.scheduled-forward-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scheduled-forward-form label:has(textarea),
.scheduled-forward-radio-group,
.scheduled-forward-checkbox,
.scheduled-forward-form .modal-actions,
.scheduled-forward-target-options {
  grid-column: 1 / -1;
}

.scheduled-forward-modal {
  max-height: min(820px, calc(100vh - 32px));
  padding: 14px;
  width: min(1020px, calc(100vw - 24px));
}

.scheduled-forward-form.scheduled-forward-task-form {
  align-items: start;
  gap: 8px 10px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.scheduled-forward-form.scheduled-forward-task-form > label {
  gap: 5px;
  grid-column: span 3;
  min-width: 0;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-textarea-field {
  grid-column: span 4;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-checkbox {
  align-self: end;
  grid-column: span 3;
  min-height: 32px;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-radio-group {
  align-self: stretch;
  grid-column: span 5;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-datetime-field {
  grid-column: span 4;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-recurrence-field,
.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-days-field,
.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-cursor-field {
  grid-column: span 2;
}

.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-cursor-date-field,
.scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-task-actions {
  grid-column: 1 / -1;
}

.scheduled-forward-target-options {
  border: 1px solid #dcece3;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.scheduled-forward-target-options-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.scheduled-forward-target-options-head strong {
  color: var(--ink);
  display: block;
  font-size: 12px;
}

.scheduled-forward-target-options-head span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.45;
}

.scheduled-forward-target-option-rows {
  display: grid;
  gap: 8px;
}

.scheduled-forward-target-option-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.35fr) minmax(120px, 0.55fr) minmax(0, 1fr) auto;
}

.scheduled-forward-target-count-field {
  display: grid;
  gap: 4px;
}

.scheduled-forward-target-count-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scheduled-forward-target-select {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.scheduled-forward-target-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scheduled-forward-target-select select {
  width: 100%;
}

.scheduled-forward-radio-group {
  background: #f4f8f5;
  border: 1px solid #dcece3;
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
}

.scheduled-forward-radio-group label,
.scheduled-forward-checkbox {
  align-items: center;
  display: flex;
  gap: 7px;
}

.scheduled-forward-form.scheduled-forward-task-form label span,
.scheduled-forward-form.scheduled-forward-task-form .scheduled-forward-radio-group span {
  font-size: 12px;
}

.scheduled-forward-form.scheduled-forward-task-form input,
.scheduled-forward-form.scheduled-forward-task-form select {
  font-size: 12px;
  min-height: 32px;
  padding: 0 9px;
}

.scheduled-forward-form.scheduled-forward-task-form textarea {
  font-size: 12px;
  min-height: 78px;
  padding: 8px 10px;
}

.scheduled-forward-form.scheduled-forward-task-form .modal-actions {
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
}

.scheduled-forward-form.scheduled-forward-task-form .modal-actions .ghost-button,
.scheduled-forward-form.scheduled-forward-task-form .modal-actions .save-button {
  min-height: 32px;
  padding: 0 12px;
}

@media (max-width: 980px) {
  .scheduled-forward-form.scheduled-forward-task-form > label,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-textarea-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-datetime-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-radio-group,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-target-options {
    grid-column: span 6;
  }

  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-checkbox {
    grid-column: 1 / -1;
  }

  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-recurrence-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-days-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-cursor-field {
    grid-column: span 4;
  }
}

@media (max-width: 640px) {
  .scheduled-forward-modal {
    padding: 12px;
    width: min(100vw - 12px, 100%);
  }

  .scheduled-forward-form.scheduled-forward-task-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .scheduled-forward-form.scheduled-forward-task-form > label,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-textarea-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-checkbox,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-radio-group,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-target-options,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-datetime-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-recurrence-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-days-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-cursor-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-cursor-date-field,
  .scheduled-forward-form.scheduled-forward-task-form > .scheduled-forward-task-actions {
    grid-column: auto;
  }

  .scheduled-forward-target-option-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
}

.scheduled-forward-form .modal-actions {
  margin-top: 4px;
}

.address-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.address-input-row {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.address-picker-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(23, 84, 48, 0.14);
  display: grid;
  gap: 10px;
  left: 0;
  min-width: min(420px, calc(100vw - 48px));
  padding: 10px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 30;
}

.address-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.address-list-row {
  align-items: center;
  background: #f6faf7;
  border: 1px solid #dcece3;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px;
}

.address-list-row span {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.address-picker textarea {
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  min-height: 86px;
  padding: 8px;
  resize: vertical;
}

.address-panel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.address-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 360px;
}

.address-chip-list span {
  background: #edf7f0;
  border: 1px solid #d4e8da;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  max-width: 180px;
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-allocation-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) 72px;
  gap: 7px;
}

.store-allocation-row input[type="number"] {
  min-height: 30px;
  min-width: 0;
  padding: 0 7px;
  width: 72px;
}

.compact-hint {
  margin: 0;
}

.group-record-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.order-price-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
}

.order-price-grid label {
  display: grid;
  gap: 5px;
}

.order-price-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.order-delete-column {
  min-width: 48px;
  text-align: center;
}

.order-delete-column input {
  min-width: auto;
  width: auto;
}

.order-delete-column .danger-mini {
  min-height: 30px;
  min-width: 0;
  padding: 0;
  width: 46px;
}

.order-action-column {
  min-width: 104px;
  text-align: center;
}

.order-row-actions {
  display: grid;
  gap: 5px;
  grid-template-columns: 48px 48px;
  justify-content: center;
}

.order-row-actions .save-button,
.order-row-actions .mini-action {
  min-height: 30px;
  min-width: 0;
  padding: 0;
  width: 48px;
}

.mono-text {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
}

.order-number-cell {
  align-items: start;
  display: grid;
  gap: 3px;
  justify-items: start;
}

.order-number-cell .mono-text {
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.order-item-count {
  background: #eef6f0;
  border: 1px solid #d8eadc;
  border-radius: 6px;
  color: #2f6b3f;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.order-product-ids {
  display: grid;
  gap: 3px;
  justify-items: start;
  margin-top: 0;
}

.copy-product-id {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  padding: 0;
  text-align: left;
  white-space: normal;
}

.copy-product-id:hover {
  text-decoration: underline;
}

.copy-product-id span {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.copy-product-id.is-copied {
  background: #eaf4ee;
  border-radius: 6px;
  color: #1f7a35;
  padding: 4px 6px;
  text-decoration: none;
}

.table-link {
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.product-note td {
  background: #f4f8f5;
  color: var(--muted);
  font-size: 12px;
  padding-top: 0;
}

.order-product-cell {
  display: grid;
  gap: 6px;
  min-width: 370px;
  white-space: normal;
}

.order-product-item,
.order-subitem,
.order-edit-stack {
  display: grid;
  gap: 5px;
}

.order-product-item--split {
  border: 1px solid #dfece3;
  border-radius: 6px;
  padding: 6px 8px;
}

.order-product-item--split + .order-product-item--split {
  margin-top: 2px;
}

.order-subitem-stack {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.order-inline-field {
  display: grid;
  gap: 3px;
}

.order-inline-field span,
.order-item-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-product-item--split .order-item-title {
  background: #f4f8f5;
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  justify-self: start;
  line-height: 1;
  padding: 4px 7px;
}

.order-product-group {
  border-bottom: 1px dashed rgba(88, 112, 94, 0.2);
  display: grid;
  gap: 2px;
  padding-bottom: 5px;
}

.order-product-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.order-product-line {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.32;
  white-space: normal;
}

.order-product-line--post,
.order-product-line--post .table-link {
  color: var(--green);
}

.order-product-line--weidian,
.order-product-line--weidian span,
.order-product-line--weidian a,
.order-product-line--weidian .table-link {
  color: #c87581;
}

.order-timing-cell {
  display: grid;
  gap: 2px;
  min-width: 148px;
}

.order-timing-cell span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.order-timing-cell strong {
  color: var(--ink);
  font-size: 12px;
}

.order-match-source-tag {
  border: 1px solid transparent;
  border-radius: 5px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
  padding: 1px 6px;
}

.order-match-source--purchased {
  background: #eaf8ef;
  border-color: #bfe6cc;
  color: #1f8a4c;
}

.order-match-source--global {
  background: #eef3ff;
  border-color: #cedcff;
  color: #315ea8;
}

.order-match-source--order-match {
  background: #fff7df;
  border-color: #f1dda3;
  color: #9a6b00;
}

.order-value-source-tag {
  align-self: start;
  border: 1px solid transparent;
  border-radius: 5px;
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  padding: 1px 6px;
  white-space: nowrap;
}

.order-value-source--manual {
  background: #fff4e8;
  border-color: #f5c48f;
  color: #9b5a11;
}

.order-value-source--auto {
  background: #f3f6ff;
  border-color: #d5def7;
  color: #3d5c99;
}

tr.is-dirty td {
  background: #fffaf0;
}

.is-profit {
  color: var(--profit);
  font-weight: 850;
}

.is-loss {
  color: var(--loss);
  font-weight: 850;
}

.is-refunded {
  color: var(--loss);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.order-amount-stack {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.25;
}

.order-amount-original.is-refund-adjusted {
  color: var(--loss);
  font-weight: 850;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.order-remaining-amount {
  color: var(--profit);
  font-size: 12px;
  font-weight: 850;
}

.status-pill {
  background: #eaf4ee;
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  padding: 5px 9px;
}

.settlement-tag {
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  padding: 2px 7px;
  white-space: nowrap;
}

.settlement-tag--settled {
  background: #e9f7ee;
  border: 1px solid #c7ead2;
  border-radius: 999px;
  color: var(--green);
}

.is-refunded-pill {
  background: #fff1ed;
  color: var(--loss);
}

.is-refunding-pill {
  background: #fff8db;
  color: #8a6100;
}

.is-partial-refund-pill {
  background: #fff5e8;
  color: #9a4f00;
}

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

.import-form,
.custom-order-form,
.employee-form,
.shop-form {
  align-items: end;
  display: grid;
  gap: 8px;
}

.import-form {
  grid-template-columns: 230px minmax(240px, 1fr) 116px;
}

.custom-order-form {
  border-top: 1px dashed rgba(88, 112, 94, 0.28);
  grid-template-areas:
    "store product-id product-name ordered-at income purchase-cost"
    "source-group source-group note note note submit";
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 10px;
  max-width: 100%;
  overflow-x: auto;
  padding-top: 10px;
}

.custom-order-form label:nth-of-type(1) {
  grid-area: store;
}

.custom-order-form label {
  min-width: 0;
}

.custom-order-form label:nth-of-type(2) {
  grid-area: product-id;
}

.custom-order-form label:nth-of-type(3) {
  grid-area: product-name;
}

.custom-order-form label:nth-of-type(4) {
  grid-area: ordered-at;
}

.custom-order-form label:nth-of-type(5) {
  grid-area: income;
}

.custom-order-form label:nth-of-type(6) {
  grid-area: purchase-cost;
}

.custom-order-form label:nth-of-type(7) {
  grid-area: source-group;
}

.custom-order-form label:nth-of-type(8) {
  grid-area: note;
}

.custom-order-form button {
  grid-area: submit;
}

.employee-form {
  grid-template-columns: 180px 180px 180px 160px 132px;
}

.shop-form {
  grid-template-columns: 220px minmax(220px, 1fr) 120px minmax(220px, 1fr) 132px;
}

.watch-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.watch-sidebar {
  display: grid;
  gap: 14px;
}

.watch-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 70px;
}

.compact-watch-form {
  grid-template-columns: minmax(0, 1fr) 76px;
}

.watch-form label,
.watch-assign-box label {
  display: grid;
  gap: 7px;
}

.watch-form span,
.watch-assign-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.watch-form input,
.watch-assign-box select,
.watch-row-actions select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 38px;
  padding: 0 10px;
}

.watch-form button,
.watch-assign-box button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 850;
  min-height: 38px;
  padding: 0 12px;
}

.watch-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watch-folder-chip,
.watch-tag-chip,
.watch-ai-placeholder {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  line-height: 1;
  min-height: 28px;
  padding: 0 10px;
}

.watch-folder-chip {
  background: color-mix(in srgb, var(--folder-color, #237447) 14%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--folder-color, #237447) 42%, #ffffff);
  color: #143823;
}

.watch-folder-chip em {
  color: var(--muted);
  font-style: normal;
}

.watch-tag-chip {
  background: #eef7f2;
  border: 1px solid #c9e2d2;
  color: #1d4d31;
}

.watch-ai-placeholder {
  background: #fff6dc;
  border: 1px solid #efd17a;
  color: #725000;
}

.watch-folder-chip button,
.watch-tag-chip button {
  background: transparent;
  border: 0;
  color: currentColor;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  min-height: auto;
  padding: 0;
}

.watch-assign-box {
  border-top: 1px dashed rgba(88, 112, 94, 0.28);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.watch-group-table {
  min-width: 1060px;
}

.watch-row-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 210px;
}

.expense-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 140px 120px 140px 180px 130px 112px minmax(220px, 1fr) 132px;
}

.capital-flow-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 140px 150px 140px 120px 170px minmax(220px, 1fr) 132px;
  margin-bottom: 14px;
}

.group-form,
.allocation-form {
  align-items: end;
  display: grid;
  gap: 12px;
}

.group-form .address-picker > .picker-summary,
.allocation-form .address-picker > .picker-summary,
.group-form .store-picker-shell > .picker-summary,
.allocation-form .store-picker-shell > .picker-summary {
  background: rgba(247, 250, 248, 0.94);
  border-radius: 4px;
  padding-left: 6px;
  position: absolute;
  right: 0;
  top: -25px;
  z-index: 1;
}

.group-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  max-width: 100%;
  overflow-x: auto;
}

.allocation-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  max-width: 100%;
  overflow-x: auto;
}

.allocation-posts-field input {
  max-width: 92px;
}

.group-form label,
.group-form .address-preview-field,
.group-form .renew-store-field,
.allocation-form label,
.shop-form label,
.expense-form label,
.capital-flow-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.group-store-field,
.group-note-field,
.address-list-field,
.allocation-store-field,
.allocation-wide-field {
  grid-column: span 2;
}

.group-form span,
.allocation-form span,
.shop-form span,
.expense-form span,
.capital-flow-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.group-form input,
.group-form select,
.group-form textarea,
.allocation-form input,
.allocation-form select,
.shop-form input,
.shop-form select,
.expense-form input,
.expense-form select,
.capital-flow-form input,
.capital-flow-form select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  outline: none;
  padding: 0 12px;
}

.group-form textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
}

.group-renew-form {
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(140px, 0.9fr) minmax(112px, 0.55fr) minmax(104px, 0.5fr) minmax(128px, 0.65fr) minmax(128px, 0.65fr);
}

.group-renew-form input,
.group-renew-form select,
.group-renew-form textarea,
.group-renew-form button {
  font-size: 14px;
  min-height: 36px;
}

.group-renew-form input,
.group-renew-form select,
.group-renew-form textarea {
  padding: 0 10px;
}

.group-renew-form textarea {
  height: 36px;
  min-height: 36px;
  overflow: hidden;
  resize: none;
  white-space: nowrap;
}

.group-renew-form .renew-price-field,
.group-renew-form .renew-price-field input,
.group-renew-form #groupRenewDailyPosts {
  max-width: 128px;
}

.group-renew-form .renew-address-field,
.group-renew-form .renew-store-field,
.group-renew-form .group-note-field {
  grid-column: span 2;
}

.address-preview-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 88px minmax(0, 1fr);
}

.address-preview-control button {
  cursor: pointer;
  text-align: center;
}

.address-preview-control strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-renew-form .compact-store-picker {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 88px minmax(0, 1fr);
}

.group-renew-form .compact-store-picker > button {
  text-align: center;
}

.group-renew-form .store-picker-shell > .picker-summary {
  background: transparent;
  min-width: 0;
  padding-left: 0;
  position: static;
}

.group-form input[readonly],
.group-form textarea[readonly] {
  background: #edf5ef;
  color: var(--muted);
}

.group-form input:focus,
.group-form select:focus,
.group-form textarea:focus,
.allocation-form input:focus,
.allocation-form select:focus,
.shop-form input:focus,
.shop-form select:focus,
.expense-form input:focus,
.expense-form select:focus,
.capital-flow-form input:focus,
.capital-flow-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.12);
}

.group-form button,
.allocation-form button,
.shop-form button,
.expense-form button,
.capital-flow-form button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 850;
  min-height: 42px;
  padding: 0 16px;
}

.group-form .store-picker-shell > button,
.allocation-form .store-picker-shell > button,
.group-record-edit-grid .store-picker-shell > button,
.group-form .address-preview-control button,
.group-form .address-input-row button,
.allocation-form .address-input-row button,
.group-record-edit-grid .address-input-row button,
.group-form .address-panel-actions button,
.allocation-form .address-panel-actions button,
.group-record-edit-grid .address-panel-actions button {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  color: var(--ink);
  min-height: 38px;
  padding: 0 10px;
}

.group-form > button,
.allocation-form > button {
  background: var(--green);
  border: 0;
  color: #ffffff;
  min-height: 42px;
  padding: 0 16px;
}

.checkbox-field {
  align-items: center;
  grid-template-columns: 1fr auto auto;
}

.checkbox-field input {
  min-height: auto;
  width: auto;
}

.checkbox-field em {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.finance-chart {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.monthly-bar-row {
  align-items: center;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 82px minmax(220px, 1fr) 250px;
  padding: 10px 12px;
}

.monthly-bar-row strong {
  color: var(--ink);
  font-size: 13px;
}

.monthly-bars {
  display: grid;
  gap: 5px;
}

.monthly-bar-line {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr);
}

.monthly-bar-line b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-align: right;
}

.monthly-bar-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.bar-track {
  background: #dfece4;
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.bar-track i {
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 3px;
}

.income-bar {
  background: linear-gradient(90deg, #9fd8ad, #237447);
}

.profit-bar {
  background: linear-gradient(90deg, #b8efd1, #16814a);
}

.loss-bar {
  background: linear-gradient(90deg, #ffd4c8, #b33939);
}

.check-dropdown {
  position: relative;
}

.check-dropdown > button {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 750;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  width: 100%;
}

.check-dropdown-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(23, 84, 48, 0.14);
  display: grid;
  gap: 6px;
  left: 0;
  max-height: 240px;
  min-width: 300px;
  overflow: auto;
  padding: 10px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 20;
}

.check-dropdown-panel label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.check-dropdown-panel input {
  min-height: auto;
  width: auto;
}

.group-board-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.group-board-table {
  table-layout: auto;
  width: max-content;
}

.group-board-table th,
.group-board-table td {
  min-width: 72px;
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.group-board-table thead th {
  background: #e4f1e8;
  position: sticky;
  top: 0;
  z-index: 5;
}

.group-board-table thead tr:nth-child(2) th {
  top: 35px;
}

.finance-table {
  min-width: 1480px;
}

.group-board-table th:first-child,
.group-board-table td:first-child {
  background: #e4f1e8;
  left: 0;
  min-width: 96px;
  position: sticky;
  text-align: left;
  width: 96px;
  z-index: 8;
}

.group-board-table td:first-child {
  background: #ffffff;
  z-index: 4;
}

.group-board-table .board-group-head {
  border-left: 2px solid #bfd9ca;
  max-width: 168px;
  min-width: 146px;
  text-align: center;
  width: 156px;
}

.group-board-table .board-group-head span {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-board-table .board-order-cell {
  min-width: 58px;
  text-align: center;
  width: 58px;
}

.group-board-table .board-revenue-cell {
  min-width: 110px;
  width: auto;
}

.board-group-even {
  background: #f8fcf9;
  border-left: 1px solid #d8e8df;
}

.board-group-odd {
  background: #eef7f1;
  border-left: 1px solid #c9dfd1;
}

.board-money-bar {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.board-money-bar::before {
  background: linear-gradient(90deg, #a9e7b5, #237447);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 8px;
  width: var(--bar-width);
}

.board-money-bar em {
  font-style: normal;
}

.shop-account-list {
  display: grid;
  gap: 10px;
}

.shop-account-card {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.shop-account-card header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.shop-account-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0;
}

.shop-pill {
  background: #e3f7df;
  border-radius: 999px;
  color: #196d3f;
  align-items: center;
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 850;
  margin: 4px 6px 0 0;
  padding: 6px 9px;
}

.shop-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-pill button {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #b8dcc6;
  border-radius: 999px;
  color: #196d3f;
  font-size: 11px;
  font-weight: 850;
  min-height: 22px;
  padding: 0 7px;
}

.shop-pill button:last-child {
  border-color: #ffc8ba;
  color: var(--loss);
}

.pager {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
}

.pager-jump {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.pager-jump input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  height: 30px;
  padding: 0 8px;
  width: 70px;
}

.pager button,
.danger-mini,
.mini-action {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 0 10px;
}

.pager button {
  background: #eef6f1;
  border: 1px solid var(--line);
  color: var(--green);
}

.pager button:disabled {
  color: #9aaaa0;
  cursor: not-allowed;
}

.reflow-bar {
  background: #c58b35;
}

.group-note-editor {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.group-note-editor textarea {
  min-height: 56px;
}

.archive-mini {
  background: #fff1ed;
  border: 1px solid #ffcabd;
  border-radius: 6px;
  color: var(--loss);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-top: 6px;
  min-height: 28px;
  padding: 0 10px;
}

.danger-mini {
  background: #fff1ed;
  border: 1px solid #ffd6cc;
  color: var(--loss);
}

.mini-action {
  background: #eef6f1;
  border: 1px solid var(--line);
  color: var(--green);
}

.role-select {
  background: #ffffff;
  border: 1px solid #c9dbd0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 32px;
  padding: 0 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-title {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.compact-title h3 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  margin: 0;
}

.file-picker input {
  padding: 9px 10px;
}

.import-result {
  color: var(--muted);
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 750;
  margin-top: 12px;
  min-height: 20px;
}

.import-result strong {
  color: var(--green);
}

.import-history {
  display: grid;
  gap: 8px;
}

.import-history article {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 11px 12px;
}

.import-history strong {
  color: var(--ink);
}

.import-history span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.role-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 7px 10px;
}

.role-staff {
  background: #edf3ef;
  color: #52675b;
}

.role-manager {
  background: #e1f0ff;
  color: #235f92;
}

.role-founder {
  background: #e3f7df;
  color: #196d3f;
}

.history-toggle summary {
  color: var(--green);
  cursor: pointer;
  font-weight: 850;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.history-list div {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.history-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.warn-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 7px 10px;
}

.warn-pill.is-expiring {
  background: #ffebe6;
  color: #b33939;
}

.warn-pill.is-expired {
  background: #ffd9d2;
  color: #972a2a;
}

.is-expiring {
  color: #b33939;
  font-weight: 850;
}

.is-expired {
  color: #972a2a;
  font-weight: 850;
}

.revenue-bars {
  align-items: end;
  display: flex;
  gap: 6px;
  min-width: 220px;
}

.revenue-bar-item {
  align-items: center;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.revenue-bar {
  background: linear-gradient(180deg, #60b57f, #237447);
  border-radius: 4px 4px 0 0;
  display: block;
  width: 10px;
}

.revenue-bar-item em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  transform: rotate(-35deg);
  transform-origin: top left;
  white-space: nowrap;
}

.placeholder-panel {
  padding: 28px;
}

.placeholder-panel.large {
  min-height: 460px;
}

.placeholder-panel h1,
.placeholder-panel h2 {
  color: var(--ink);
  font-size: 34px;
  line-height: 1.1;
}

.placeholder-panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin-top: 12px;
  max-width: 760px;
}

.ai-analysis-mode-toolbar,
.tt-mode-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
}

.segmented-control button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 14px;
}

.segmented-control button.is-active {
  background: var(--accent);
  color: #fff;
}

.ai-analysis-mode-actions,
.tt-mode-actions {
  display: flex;
  gap: 8px;
}

.sparkline {
  align-items: end;
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(30, minmax(2px, 1fr));
  height: 54px;
  margin: 10px 0 2px;
}

.sparkline i {
  background: #d84a89;
  border-radius: 3px 3px 0 0;
  display: block;
  min-height: 8px;
}

.sparkline i.hourly {
  background: #6f9f34;
}

.sparkline-empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
}

.ai-recommendation-insight-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.insight-empty,
.insight-chart,
.insight-tags,
.insight-score {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.insight-tags div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  min-height: 54px;
}

.insight-tags em {
  background: #fff2f7;
  border-radius: 999px;
  color: #a63168;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 9px;
}

@media (max-width: 900px) {
  .ai-recommendation-insight-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .front-weight-overview,
  .front-weight-grid,
  .front-weight-row,
  .front-weight-slider {
    grid-template-columns: 1fr;
  }

  .ai-recommendation-board {
    grid-template-columns: 1fr;
  }

  body {
    min-width: 0;
  }

  .login-view,
  .workspace {
    display: block;
  }

  .login-view {
    min-height: auto;
    padding: 30px 16px;
  }

  .login-copy {
    margin-bottom: 24px;
  }

  .login-copy h1 {
    font-size: 46px;
  }

  .sidebar {
    min-height: auto;
    position: relative;
  }

  .content {
    padding: 18px 12px;
  }

  .content-head,
  .section-title {
    align-items: start;
    display: grid;
    gap: 10px;
  }

  .content-head h1 {
    font-size: 32px;
  }

  .sub-tabs {
    overflow-x: auto;
  }

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

  #businessDataCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-store-data-title,
  .business-store-controls,
  .business-store-period-tabs {
    justify-content: flex-start;
  }

  .order-price-grid {
    grid-template-columns: 1fr;
  }

  .import-form,
  .custom-order-form,
  .employee-form,
  .shop-form,
  .group-form,
  .allocation-form,
  .expense-form,
  .capital-flow-form,
  .scheduled-forward-control-row,
  .scheduled-forward-form {
    grid-template-areas: none;
    grid-template-columns: 1fr;
  }

  .scheduled-forward-form label:has(textarea),
  .scheduled-forward-radio-group,
  .scheduled-forward-checkbox,
  .scheduled-forward-form .modal-actions {
    grid-column: auto;
  }

  .group-store-field,
  .group-note-field,
  .allocation-store-field,
  .allocation-wide-field,
  .record-store-field {
    grid-column: auto;
  }

  .monthly-bar-row {
    grid-template-columns: 1fr;
  }

  .person-income-controls {
    justify-content: flex-start;
  }

  .person-income-board {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .person-income-date-column,
  .person-income-value-list {
    grid-auto-rows: 54px;
  }

  .person-income-date-column {
    grid-template-rows: 74px;
  }

  .person-income-date-cell {
    font-size: 15px;
  }

  .person-income-card {
    flex-basis: 280px;
  }

  .person-income-card-head {
    flex-basis: 74px;
    grid-template-rows: 36px 38px;
  }
}

@media (max-width: 640px) {
  #businessDataCards {
    grid-template-columns: 1fr;
  }

  .business-store-controls {
    display: grid;
    justify-items: stretch;
    width: 100%;
  }

  .business-store-period-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-recommendation-insight-cards,
  .ai-recommendation-summary,
  .ai-recommendation-metrics,
  .front-weight-overview {
    grid-template-columns: 1fr;
  }
}

.local-preview-banner {
  align-items: center;
  background: #fff7db;
  border: 1px solid #e3c96a;
  border-radius: 20px;
  color: #6f5310;
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 12px 16px;
}

.local-preview-banner strong {
  font-size: 14px;
}

.local-preview-banner span {
  font-size: 13px;
  line-height: 1.5;
}

.local-preview-readonly button[data-local-preview-readonly="1"] {
  cursor: not-allowed;
  opacity: 0.55;
}
