/* Lailara Design System v2 — SKU Rationalization Demo */

/* ─── Self-hosted fonts ───────────────────────────────── */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --canvas:        #f5f3ee;
  --ink:           #0d0d0d;
  --text-primary:  #333333;
  --text-secondary:#595959;
  --grid-line:     #d9d9d9;
  --reference:     #666666;
  --disabled:      #b3b3b3;
  --navy:          #1f2e7a;
  --navy-hover:    #141e52;
  --navy-light:    #8e9ad0;
  --red:           #cc100a;
  --teal-5:        #063d32;
  --teal-35:       #158f75;
  --teal-55:       #35b595;
  --teal-70:       #6dcdb5;
  --teal-85:       #b5e4d8;
  --hk-dark:       #0a5c4b;
  --hk-dark-light: #e4f5f0;
  --card-bg:       #1a1a1a;
  --card-text:     #ffffff;
  --card-subtitle: #d8d8d8;
  --card-muted:    #9a9a9a;
  --card-border:   rgba(255,255,255,0.12);
  --card-item:     #ededed;
  --q-double-down: #158f75;
  --q-maintain:    #1f2e7a;
  --q-fix-or-kill: #ee8a2a; /* Singapore-55 — warning signal */
  --sg-55:         #ee8a2a;
  --sg-95:         #fdeee0;
  --sg-20:         #7a3d10;
  --q-kill:        #cc100a;
  --chicago-95:    #e8eaf4; /* Chicago-95 — table row hover, info surface, selected state */
  --red-95:        #fce8e7; /* Red-95 — error/kill badge surface, alert banner background */
  --radius:        2px;
  --content-max:   900px;
  --font-serif:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:     'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────── */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--canvas);
  border-bottom: 1px solid var(--grid-line);
  padding: 28px 0 24px;
}
.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  padding-top: 4px;
}
.site-header__brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.site-header__brand-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.site-header__divider {
  width: 1px;
  background: var(--grid-line);
  align-self: stretch;
  flex-shrink: 0;
}
.site-header__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.site-header__meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ─── Main ───────────────────────────────────────────── */
.main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* ─── Section titles ─────────────────────────────────── */
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 20px;
}

/* ─── Quadrant summary ───────────────────────────────── */
.quadrant-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.quadrant-card {
  background: white;
  border-left: 4px solid var(--grid-line);
  padding: 16px 18px 14px;
  cursor: pointer;
  transition: box-shadow 120ms ease, opacity 120ms ease;
  border-radius: var(--radius);
}
.quadrant-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.quadrant-card.is-active { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.quadrant-card.is-dimmed { opacity: 0.4; }
.quadrant-card--double-down { border-left-color: var(--q-double-down); }
.quadrant-card--maintain    { border-left-color: var(--q-maintain); }
.quadrant-card--fix-or-kill { border-left-color: var(--q-fix-or-kill); }
.quadrant-card--kill        { border-left-color: var(--q-kill); }
.quadrant-card__count {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.quadrant-card--double-down .quadrant-card__count { color: var(--q-double-down); }
.quadrant-card--maintain    .quadrant-card__count { color: var(--q-maintain); }
.quadrant-card--fix-or-kill .quadrant-card__count { color: var(--q-fix-or-kill); }
.quadrant-card--kill        .quadrant-card__count { color: var(--q-kill); }
.quadrant-card__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quadrant-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

/* ─── Weight controls ────────────────────────────────── */
.weight-controls { }
.sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.slider-row {
  display: grid;
  grid-template-columns: 200px 1fr 52px;
  align-items: center;
  gap: 12px;
}
.slider-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}
.slider-input {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--grid-line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--navy);
  border-radius: 50%;
  cursor: pointer;
  transition: background 120ms;
}
.slider-input::-webkit-slider-thumb:hover { background: var(--navy-hover); }
.slider-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--navy);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.slider-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.weight-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 120ms;
}
.btn--secondary {
  background: white;
  color: var(--navy);
  border: 1px solid var(--grid-line);
}
.btn--secondary:hover { background: var(--canvas); border-color: var(--navy-light); }
.weight-total {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── Bucket filter ──────────────────────────────────── */
.bucket-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bucket-filter__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.bucket-filter__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bucket-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--grid-line);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 120ms;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bucket-btn:hover { border-color: var(--navy-light); color: var(--text-primary); }
.bucket-btn.is-active { color: white; border-color: transparent; }
.bucket-btn--all.is-active         { background: var(--text-primary); }
.bucket-btn--double-down.is-active { background: var(--q-double-down); }
.bucket-btn--maintain.is-active    { background: var(--q-maintain); }
.bucket-btn--fix-or-kill.is-active { background: var(--q-fix-or-kill); }
.bucket-btn--kill.is-active        { background: var(--q-kill); }

/* ─── Charts ─────────────────────────────────────────── */
.dim-charts-stack {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.chart-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
}
.chart-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.chart-container {
  width: 100%;
}

/* ─── SKU table ──────────────────────────────────────── */
.sku-table-section { }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-filter {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  background: white;
  color: var(--text-primary);
  cursor: pointer;
}
.table-filter:focus { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.table-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: auto;
}
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
}
.sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}
.sku-table thead th {
  background: var(--canvas);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--grid-line);
  white-space: nowrap;
}
.sku-table th.dim-col { text-align: center; }
.sku-table tbody tr {
  border-bottom: 1px solid var(--grid-line);
  transition: background 80ms;
  cursor: pointer;
}
.sku-table tbody tr:last-child { border-bottom: none; }
.sku-table tbody tr:hover { background: var(--chicago-95); }
.sku-table td { padding: 9px 12px; }
.sku-table td.sku-code {
  font-family: monospace;
  font-size: 12px;
  color: var(--navy);
  font-weight: 600;
}
.sku-table td.product-line {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.sku-table td.dim-col { text-align: center; }
.score-cell {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.badge--double-down { background: var(--hk-dark-light); color: var(--q-double-down); }
.badge--maintain    { background: var(--chicago-95); color: var(--q-maintain); }
.badge--fix-or-kill { background: var(--sg-95); color: var(--sg-20); }
.badge--kill        { background: var(--red-95); color: var(--q-kill); }

/* ─── Detail card ────────────────────────────────────── */
.detail-card {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 300px;
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 2px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.32);
  z-index: 100;
  font-size: 14px;
}
.detail-card[hidden] { display: none; }
.detail-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.detail-card__sku {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--card-text);
  letter-spacing: 0.03em;
}
.detail-card__close {
  background: none;
  border: none;
  color: var(--card-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 0 0 8px;
  line-height: 1;
}
.detail-card__close:hover { color: var(--card-text); }
.detail-card__product-line {
  font-size: 12px;
  color: var(--card-muted);
  margin-bottom: 14px;
}
.detail-card__composite {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 14px;
}
.detail-card__composite-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--card-muted);
}
.detail-card__composite-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.detail-card__dims {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.dim-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.dim-row__name {
  font-size: 11px;
  color: var(--card-subtitle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dim-row__bar-track {
  width: 60px;
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}
.dim-row__bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--teal-35);
  transition: width 200ms ease;
}
.dim-row__bar-fill--low { background: var(--q-kill); }
.dim-row__bar-fill--mid { background: var(--hk-dark); }
.dim-row__bar-fill--high { background: var(--teal-35); }
.dim-row__score {
  font-size: 12px;
  font-weight: 700;
  color: var(--card-text);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
}
.detail-card__note {
  font-size: 10px;
  color: var(--card-muted);
  font-style: italic;
  line-height: 1.4;
  border-top: 1px solid var(--card-border);
  padding-top: 10px;
}

/* ─── Error state ────────────────────────────────────── */
.load-error {
  background: var(--red-95);
  color: var(--q-kill);
  border: 1px solid var(--q-kill);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--grid-line);
  padding: 20px 0;
  margin-top: 40px;
}
.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.site-footer__source {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}
.site-footer__branding {
  font-size: 11px;
  color: var(--disabled);
  white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 720px) {
  .quadrant-summary { grid-template-columns: repeat(2, 1fr); }
  .slider-row { grid-template-columns: 140px 1fr 44px; }
  .site-header__inner { flex-direction: column; gap: 12px; }
  .site-header__divider { display: none; }
  .detail-card { right: 12px; left: 12px; width: auto; top: auto; bottom: 0; border-radius: 2px 2px 0 0; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 480px) {
  .quadrant-summary { grid-template-columns: 1fr 1fr; }
  .site-header__title { font-size: 22px; }
  .section-title { font-size: 18px; }
}

/* ─── Print ──────────────────────────────────────────── */
@media print {
  .detail-card, .weight-controls, .btn { display: none; }
  .site-header { border-bottom: 1px solid var(--text-primary); }
  body { background: white; }
  @page { size: letter; margin: 0.6in; }
}
