/* SR Wholesale — brand hooks for flux-ui.css, plus the layout flux-ui.css
   deliberately doesn't provide (it's structural-only, see its own header). */
:root {
  --ui-ink: #241414;
  --ui-paper: #FFF8F5;
  --ui-accent: #9A2846;
  --ui-ink-rgb: 36, 20, 20;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ui-paper); color: var(--ui-ink); font-family: -apple-system, system-ui, sans-serif; }
a { color: var(--ui-accent); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.site-header { border-bottom: 1px solid var(--ui-line); padding: .75rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--ui-ink); }
.site-header nav a { margin-left: 1rem; text-decoration: none; color: var(--ui-ink); }

.btn { display: inline-block; padding: .6rem 1.1rem; border-radius: .5rem; border: 1px solid var(--ui-line-2);
  background: var(--ui-sunk); color: var(--ui-ink); text-decoration: none; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--ui-accent); color: #fff; border-color: var(--ui-accent); }
.btn-danger { background: var(--ui-danger); color: #fff; border-color: var(--ui-danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Public catalog ---- */
.category-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.pill { padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--ui-line-2); color: var(--ui-ink);
  text-decoration: none; font-size: .85rem; background: #fff; }
.pill.active { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; padding: 1rem 0 2rem; }
.catalog-card { border: 1px solid var(--ui-line); border-radius: .75rem; overflow: hidden; background: #fff;
  transition: transform .15s ease, box-shadow .15s ease; }
.catalog-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(var(--ui-ink-rgb), .1); }
.catalog-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--ui-sunk); display: block; }
.catalog-card-placeholder { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--ui-dim); color: var(--ui-accent); font-size: 2.5rem; font-weight: 700; }
.catalog-card .meta { padding: .6rem .75rem; }
.category-badge { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ui-accent); font-weight: 600; margin-bottom: .25rem; }
.catalog-card .price { font-weight: 700; color: var(--ui-accent); }
.new-arrivals-banner { background: var(--ui-accent); color: #fff; padding: .75rem 1rem; text-align: center; border-radius: .5rem; margin: 1rem 0; }

/* ---- Till ---- */
.till-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem 0; }
@media (max-width: 720px) { .till-layout { grid-template-columns: 1fr; } }
#scanner-video { width: 100%; max-height: 320px; background: #000; border-radius: .5rem; }
.cart-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--ui-line); }
.cart-row .qty-controls button { width: 1.8rem; }
#sync-badge { position: fixed; top: .5rem; right: .5rem; padding: .4rem .8rem; border-radius: 1rem; font-size: .85rem;
  background: var(--ui-sunk); border: 1px solid var(--ui-line-2); z-index: 50; }
#sync-badge.online { background: #e6f7ed; border-color: #2a9d5c; }
#sync-badge.offline { background: #fff3cd; border-color: #c99a1f; }
#sync-badge.syncing { background: #e6f0ff; border-color: #3a66d6; }
#sync-badge.failed { background: #fde2e1; border-color: var(--ui-danger); }
.manual-code-row { display: flex; gap: .5rem; margin-top: .5rem; }

/* ---- Dashboard ---- */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1rem 0; }
.dash-card { border: 1px solid var(--ui-line); border-radius: .75rem; padding: 1rem; background: #fff; }
.dash-card .big { font-size: 1.8rem; font-weight: 700; }
.dash-card-title { font-weight: 600; margin-bottom: .75rem; color: var(--ui-muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; align-items: start; }
@media (max-width: 720px) { .dash-row { grid-template-columns: 1fr; } }
table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--ui-line); }

/* 7-day trend — single-hue magnitude bars, thin, rounded data-ends anchored
   to the baseline, 2px gaps, recessive baseline; value is the direct label
   (7 points, not a line with many — safe to label each per dataviz guidance). */
.trend-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 1.2rem; }
.trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-value { font-size: .7rem; color: var(--ui-muted); margin-bottom: .25rem; white-space: nowrap; }
.trend-bar { width: 100%; max-width: 28px; background: var(--ui-accent); border-radius: 4px 4px 0 0; min-height: 2px; border-bottom: 2px solid var(--ui-line-2); }
.trend-label { font-size: .7rem; color: var(--ui-muted); margin-top: .35rem; }

/* ---- Label sheet (print) ---- */
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; padding: 4mm; }
.label-card { border: 1px dashed #999; border-radius: 3mm; padding: 3mm; text-align: center; }
.label-card .qr-canvas { width: 28mm; height: 28mm; margin: 0 auto; }
.label-card .sku { font-size: 7pt; color: #666; }
@media print {
  .no-print { display: none !important; }
  .label-card { border: none; }
}

.login-form { max-width: 320px; margin: 3rem auto; display: flex; flex-direction: column; gap: .75rem; }
.login-form input { padding: .6rem; border: 1px solid var(--ui-line-2); border-radius: .4rem; }
