:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ea;
  --ink: #17211b;
  --muted: #687267;
  --line: #d7ddd2;
  --green: #1f7a4d;
  --green-2: #e0f1e8;
  --gold: #b7791f;
  --red: #b84242;
  --blue: #315f85;
  --shadow: 0 18px 50px rgba(34, 43, 36, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 33, 27, 0.92), rgba(31, 122, 77, 0.72)),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-logo {
  justify-self: center;
  width: min(210px, 70%);
  height: auto;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

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

.auth-form input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.cognito-login {
  width: 100%;
  min-height: 44px;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.app-shell.auth-pending {
  display: none;
}

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

.sidebar {
  background: #17211b;
  color: #f8fbf4;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
}

.brand {
  display: grid;
  place-items: center;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.brand-logo {
  display: block;
  width: min(166px, 100%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.store-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  color: #d9e5d6;
  background: transparent;
  padding: 10px 12px;
  text-decoration: none;
  text-align: left;
}

.nav-item.active,
.nav-item:hover,
.store-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  color: #a8d4b5;
}

.store-link {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.dashboard-sales-card {
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.expenses-summary-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr) minmax(240px, 0.8fr);
  gap: 14px;
  margin-bottom: 18px;
}

.inventory-summary-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(190px, 0.65fr) minmax(280px, 1.3fr);
  gap: 14px;
  margin-bottom: 18px;
}

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

.metric {
  padding: 18px;
  display: grid;
  align-content: start;
}

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

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.metric-breakdown {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.metric-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.metric-mini-row span {
  margin: 0;
}

.metric-filter-row {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin: -4px -6px;
}

.metric-filter-row:hover,
.metric-filter-row:focus {
  background: #f1f7ef;
  color: var(--ink);
  outline: none;
}

.metric-mini-row strong {
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.inventory-unlisted-headline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.inventory-unlisted-headline > div {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding-bottom: 1px;
}

.inventory-unlisted-headline span {
  margin: 0;
  font-size: 12px;
}

.inventory-unlisted-headline b {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.inventory-unlisted-card .unlisted-category-summary {
  margin-top: 16px;
}

.base-card-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.unlisted-category-summary {
  display: grid;
  gap: 7px;
}

.base-card-head,
.base-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.base-card-head span {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.base-card-row {
  padding: 8px 0;
  border-top: 1px solid #eef1ec;
}

.base-card-row.summary-row {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dde6d9;
  border-radius: 8px;
  background: #f8fbf6;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.base-card-row.summary-row:hover,
.base-card-row.summary-row:focus,
.base-card-row.summary-row.active {
  border-color: #9fbe9b;
  background: #f1f7ef;
  outline: none;
}

.base-card-row.lot-row:first-child {
  margin-top: 4px;
}

.base-card-row strong,
.base-card-row b {
  font-size: 13px;
  line-height: 1.2;
}

.base-card-row span,
.base-card-empty {
  color: var(--muted);
  font-size: 12px;
}

.base-card-row b {
  font-variant-numeric: tabular-nums;
}

.dashboard-orders-card .metric-mini-row {
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
}

.dashboard-orders-card .metric-mini-row strong {
  justify-self: end;
  min-width: 112px;
  font-variant-numeric: tabular-nums;
}

.orders-summary-grid {
  display: grid;
  grid-template-columns: minmax(390px, 1.15fr) minmax(280px, 0.9fr) minmax(340px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.orders-value-breakdown {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.orders-value-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.orders-value-source {
  background: #f7faf5;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.orders-value-source-head {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.orders-value-source-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.orders-value-source-head strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.orders-value-source-stats {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.orders-value-source-stats div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 12px;
}

.orders-value-source-stats strong {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.orders-day-card {
  margin-bottom: 18px;
}

.orders-sport-card {
  min-height: 230px;
}

.orders-breakdown-list,
.orders-player-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.orders-breakdown-row,
.orders-player-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.orders-breakdown-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.orders-player-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
}

.orders-breakdown-row:last-child,
.orders-player-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.orders-breakdown-row:hover,
.orders-breakdown-row.active,
.orders-player-row:hover,
.orders-player-row.active {
  color: var(--ink);
}

.orders-breakdown-row.active strong {
  color: var(--green);
}

.orders-player-row.active .player-rank {
  background: var(--green);
  color: #ffffff;
}

.orders-breakdown-row div,
.orders-player-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.orders-breakdown-row strong,
.orders-player-row strong,
.sales-day-head strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.orders-breakdown-row span,
.orders-player-row span {
  color: var(--muted);
  font-size: 12px;
}

.orders-breakdown-row b,
.orders-player-row b,
.sales-chart-summary strong {
  font-size: 13px;
  white-space: nowrap;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef3ea;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.channel-pill.ebay {
  color: #0654ba;
  background: #eef5ff;
  border-color: #c9dcf7;
}

.channel-pill.psa {
  color: #9b1c31;
  background: #fff0f3;
  border-color: #f3c5cf;
}

.channel-pill.direct {
  color: #735100;
  background: #fff8df;
  border-color: #ead793;
}

.plain-title {
  cursor: default;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-action {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 7px;
}

.player-rank {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green) !important;
  font-size: 11px !important;
  font-weight: 800;
}

.sales-line-chart {
  display: grid;
  margin-top: 8px;
}

.sales-chart-wrap {
  display: grid;
  gap: 10px;
}

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

.sales-chart-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
}

.sales-chart-summary strong {
  display: block;
  color: var(--ink);
}

.sales-chart-summary span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.sales-line-svg {
  display: block;
  width: 100%;
  height: 180px;
  min-height: 0;
}

.sales-line-chart.compact .sales-line-svg {
  height: 160px;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(31, 122, 77, 0.1);
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  cursor: pointer;
  outline: none;
}

.chart-hit-area {
  fill: transparent;
  stroke: transparent;
}

.chart-dot {
  fill: #ffffff;
  stroke: var(--green);
  stroke-width: 2.5;
  transition: r 140ms ease, stroke-width 140ms ease;
}

.chart-point:hover .chart-dot,
.chart-point:focus .chart-dot {
  r: 6;
  stroke-width: 3.5;
}

.chart-y-label,
.chart-x-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.chart-point:hover .chart-tooltip,
.chart-point:focus .chart-tooltip {
  opacity: 1;
}

.chart-tooltip rect {
  fill: #17211b;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
}

.chart-tooltip text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.chart-y-label {
  text-anchor: end;
}

.chart-x-label {
  text-anchor: middle;
}

.empty-summary {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.drafts-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
}

.expenses-grid {
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.35fr);
}

.expenses-ledger-panel .toolbar {
  padding: 14px 16px 0;
}

.expenses-toolbar select,
.expenses-toolbar input[type="number"] {
  width: auto;
  min-width: 150px;
}

.category-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 0 16px 4px;
}

.secondary-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 18px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-actions,
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(380px, 100%);
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  height: 44px;
}

.search-box input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: 0;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.segment {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0 14px;
  color: var(--muted);
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: var(--green-2);
  color: var(--green);
  font-weight: 700;
}

.primary-btn,
.text-btn,
.icon-btn,
.file-chip {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-btn {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  font-weight: 700;
}

.ebay-sync-btn {
  background: #ffffff;
  color: var(--ink);
  border-color: #cfd8ce;
  padding: 0 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ebay-sync-btn:hover {
  border-color: #b8c5b7;
  background: #fbfcfa;
}

.ebay-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}

.ebay-e {
  color: #e53238;
}

.ebay-b {
  color: #0064d2;
}

.ebay-a {
  color: #f5af02;
}

.ebay-y {
  color: #86b817;
}

.text-btn {
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.file-action {
  cursor: pointer;
  position: relative;
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.danger-btn {
  color: #b42318;
}

.danger-btn:hover {
  color: #7a271a;
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 20px;
}

.hidden {
  display: none !important;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  background: #f8faf6;
}

.sort-header {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-header.active,
.sort-header:hover {
  color: var(--ink);
}

.sort-indicator {
  display: inline-grid;
  place-items: center;
  width: 12px;
  min-width: 12px;
  color: var(--green);
  font-size: 11px;
  line-height: 1;
}

tr:hover td {
  background: #fbfcfa;
}

.select-col {
  width: 42px;
}

.listing-cell {
  display: grid;
  gap: 4px;
  min-width: 280px;
  max-width: 520px;
}

.listing-cell.compact {
  min-width: 150px;
}

.listing-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.listing-title-row .listing-title {
  flex: 1 1 auto;
  min-width: 0;
}

.sell-direct-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.thumb-btn {
  width: 54px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
}

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

.listing-title {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-weight: 700;
}

.link-title {
  display: inline;
  text-decoration: none;
}

.link-title:hover {
  color: var(--green);
  text-decoration: underline;
}

.listing-meta {
  color: var(--muted);
  font-size: 12px;
}

.inventory-meta-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  white-space: nowrap;
  scrollbar-width: thin;
}

.inventory-meta-strip > * {
  flex: 0 0 auto;
}

.muted-cell {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf0ec;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  background: var(--green-2);
  color: var(--green);
}

.tag.gold {
  background: #faeed8;
  color: var(--gold);
}

.tag.red {
  background: #f8e4e4;
  color: var(--red);
}

.expense-auto-row {
  background: #fbfcfa;
}

.editable-expense-row {
  cursor: pointer;
}

.editable-expense-row:hover,
.editable-expense-row:focus {
  background: #f6faf4;
  outline: none;
}

.cost-input-wrap {
  width: 88px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
}

.cost-input-wrap span {
  font-size: 12px;
}

.cost-input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cost-input::-webkit-outer-spin-button,
.cost-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.cost-input:focus {
  outline: none;
}

.cost-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.12);
}

.sport-select {
  width: 128px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 6px 8px;
}

.sport-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.12);
}

.sport-sync-note {
  margin-top: 6px;
  white-space: nowrap;
}

.profit-cell {
  font-weight: 800;
  white-space: nowrap;
}

.profit-positive {
  color: var(--green);
}

.profit-negative {
  color: var(--red);
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.watch-list,
.import-list,
.dashboard-player-list,
.pricing-list,
.draft-list,
.status-stack,
.sport-list {
  display: grid;
}

.handoff-panel {
  margin-top: 18px;
}

.handoff-panel textarea {
  display: block;
  min-height: 260px;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #fbfcfa;
}

.agent-result-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.agent-result-box textarea {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.watch-row,
.import-row,
.dashboard-player-row,
.pricing-row,
.draft-row,
.status-line {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sport-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, auto) minmax(124px, auto);
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.sport-row strong {
  font-size: 15px;
  white-space: nowrap;
  text-align: right;
}

.sport-head {
  background: #f8faf6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sport-head span:nth-child(2),
.sport-head span:nth-child(3) {
  text-align: right;
}

.editable-order-row {
  cursor: pointer;
}

.editable-order-row:hover,
.editable-order-row:focus {
  background: #f6faf4;
  outline: none;
}

.watch-row,
.dashboard-player-row,
.pricing-row,
.draft-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.dashboard-player-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dashboard-player-row:hover {
  color: var(--ink);
}

.dashboard-player-row.empty {
  cursor: default;
}

.import-row,
.status-line {
  grid-template-columns: minmax(0, 1fr) auto;
}

.watch-row:last-child,
.import-row:last-child,
.dashboard-player-row:last-child,
.pricing-row:last-child,
.draft-row:last-child,
.status-line:last-child {
  border-bottom: 0;
}

.row-title {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.price-delta {
  font-weight: 800;
}

.price-delta.down {
  color: var(--red);
}

.price-delta.up {
  color: var(--green);
}

.form-panel {
  padding-bottom: 16px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  padding: 10px 11px;
  min-height: 40px;
  outline-color: var(--green);
  resize: vertical;
}

textarea {
  line-height: 1.4;
}

.wide {
  grid-column: 1 / -1;
}

.form-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  min-height: 18px;
}

.file-chip {
  position: relative;
  overflow: hidden;
  color: var(--green);
  font-weight: 800;
}

.filter-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.filter-chip:empty {
  display: none;
}

.file-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 31, 25, 0.46);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.manual-order-form {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px, 100vw);
  transform: translateX(105%);
  transition: transform 180ms ease;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.drawer-body {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.image-strip a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf6;
}

.image-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

.psa-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(4, max-content);
  gap: 10px;
  align-items: end;
}

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

.detail-field {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.detail-field strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(150%);
  min-width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  background: #17211b;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
  z-index: 30;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
  }

  .brand {
    display: none;
  }

  .nav {
    display: flex;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .store-link {
    display: none;
  }

  .main {
    padding: 18px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .metrics-grid,
  .orders-summary-grid,
  .expenses-summary-grid,
  .inventory-summary-grid,
  .content-grid,
  .drafts-grid {
    grid-template-columns: 1fr;
  }

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

  .category-add-row {
    grid-template-columns: 1fr;
  }

  .sales-chart-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .toolbar {
    display: grid;
  }

  .segmented {
    grid-auto-flow: row;
  }

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

  .segment:last-child {
    border-bottom: 0;
  }

  .metric strong {
    font-size: 24px;
  }

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