/* Rate of Sale (merchandising) view — js/views/ros.js.
   Reuses the shared design vocabulary (kpi-card, data-table, seg-btn,
   metric-chip) and adds only the bits unique to this view: the category
   chip row, the DC comparison strip, and the Category/Series/Item
   hierarchy row tints. */

.ros-empty, .ros-none {
  padding: 40px; text-align: center; color: #6b7280;
  font-family: var(--font-stack); font-size: 14px;
}
.ros-empty code, .ros-none code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; }

/* Controls row: category chips + optional DC/store picker. */
.ros-controls {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 4px 0 14px;
}
/* "All categories" export toggle: a chip set slightly apart from the six
   category chips, plus an inline hint when the combined export is armed. */
.ros-chip-all { margin-left: 6px; border-style: dashed; }
.ros-chip-all.active { border-style: solid; }
.ros-exportall-hint {
  flex-basis: 100%; font-size: 11px; color: #6b7280;
  font-family: var(--font-stack); margin-top: -6px;
}

.ros-picker-row { display: inline-flex; align-items: center; gap: 8px; }
.ros-picker-lbl {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.ros-store-select {
  padding: 4px 10px; font-size: 12px; font-family: var(--font-stack);
  border: 1px solid var(--table-border); border-radius: 6px; background: #fff;
  color: var(--navy); font-weight: 600;
}

/* Scope + category + window caption above the KPI row. */
.ros-kpi-scope {
  font-size: 12px; font-weight: 600; color: #6b7280;
  font-family: var(--font-stack); margin: 0 0 8px; letter-spacing: 0.2px;
}
.ros-kpi-row { grid-template-columns: repeat(4, 1fr); }

/* DC comparison strip — 3 physical serving DCs side by side. */
.ros-dc-strip { margin: 0 0 16px; }
.ros-dc-strip-lbl {
  font-size: 13px; font-weight: 700; color: var(--navy);
  font-family: var(--font-stack); margin: 0 0 8px;
}
.ros-dc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ros-dc-card {
  text-align: left; background: #fff; border: 1px solid var(--table-border);
  border-radius: 8px; padding: 12px 14px; cursor: pointer;
  font-family: var(--font-stack); transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow);
}
.ros-dc-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.ros-dc-card.ros-dc-active { border-color: var(--ashley-orange); border-width: 2px; padding: 11px 13px; }
.ros-dc-name { font-size: 12px; font-weight: 700; color: var(--navy); }
.ros-dc-units { font-size: 24px; font-weight: 700; color: #334155; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ros-dc-sub { font-size: 11px; color: #6b7280; }
.ros-dc-bar { height: 5px; background: #eef1f4; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.ros-dc-bar span { display: block; height: 100%; background: var(--primary-blue); }

/* Hierarchy table. Reuses .data-table; adds row tints + drill affordance. */
.ros-table-wrap { overflow-x: auto; }
.ros-table { min-width: 900px; }
.ros-table th.ros-num, .ros-table td.ros-num { text-align: right; font-variant-numeric: tabular-nums; }
.ros-table th.ros-th-item { width: 130px; }
.ros-table th.sortable { cursor: pointer; user-select: none; }
.ros-th-hint {
  display: block; font-size: 9px; font-weight: 500; color: #9ca3af;
  text-transform: none; letter-spacing: 0;
}

/* Category total row — navy, anchors the table like the Detailed Report Total. */
.ros-table tr.ros-row-cat td {
  background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--navy);
}
.ros-table tr.ros-row-cat td:first-child { background: var(--navy); }

/* Series rows — medium tint, clickable to drill. */
.ros-table tr.ros-row-series { cursor: pointer; }
.ros-table tr.ros-row-series td { background: #eef2f6; font-weight: 600; color: var(--navy); }
.ros-table tr.ros-row-series:hover td { background: #e2e9f0; }
.ros-table tr.ros-row-series td:first-child { background: #eef2f6; }
.ros-series-id { font-variant-numeric: tabular-nums; }
.ros-caret { color: var(--ashley-orange); margin-right: 6px; font-size: 10px; }
.ros-series-name { color: #475569; font-weight: 500; }

/* Item rows — white, indented item number. */
.ros-table tr.ros-row-item td { background: #fff; color: #334155; }
.ros-table tr.ros-row-item:hover td { background: var(--light-bg); }
.ros-item-no { font-variant-numeric: tabular-nums; color: #6b7280; padding-left: 26px !important; font-size: 12px; }
.ros-item-name { color: #334155; }
.ros-dim { color: #9ca3af; }

/* Attach analytics. Anchor tag + low-attach flag. */
.ros-anchor-tag {
  font-size: 10px; font-weight: 700; color: var(--primary-blue);
  background: #eef4f8; border-radius: 4px; padding: 1px 6px;
}
.ros-attach-low { color: var(--signal-red, #dc2626); font-weight: 700; }
.ros-flag {
  font-size: 9px; font-weight: 700; color: #fff; background: var(--signal-red, #dc2626);
  border-radius: 3px; padding: 0 4px; margin-left: 3px; vertical-align: middle;
}
