/* Drill-down sub-page */
[data-drill] { cursor: pointer; }
[data-drill]:hover, [data-drill]:focus-visible { outline: 2px solid var(--hh-red, #E4002B); outline-offset: 2px; }
.sx-kpi[data-drill]:hover, .card.metric[data-drill]:hover { box-shadow: 0 0 0 2px var(--hh-red, #E4002B) inset; }
td [data-drill], td[data-drill] { text-decoration: underline dotted; text-underline-offset: 3px; }
.drill-hint { font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--hh-muted, #5a5a5a); }
body.hd-open { overflow: hidden; }
.hd-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(18,18,18,.55); display: flex; justify-content: center; align-items: flex-start; padding: 2.5vh 1rem; overflow: auto; }
.hd-overlay[hidden] { display: none; }
.hd-page { background: #fff; border: 3px solid var(--hh-charcoal, #121212); border-radius: 14px; box-shadow: 6px 6px 0 var(--hh-charcoal, #121212); width: min(1240px, 100%); min-height: 60vh; display: flex; flex-direction: column; }
.hd-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; background: var(--hh-yellow, #FFC700); border-bottom: 3px solid var(--hh-charcoal, #121212); border-radius: 11px 11px 0 0; position: sticky; top: 0; z-index: 2; }
.hd-titles { flex: 1 1 auto; min-width: 0; }
.hd-crumb { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5a3d00; }
.hd-head h2 { margin: .05rem 0; font-size: 1.35rem; line-height: 1.1; }
.hd-sub { font-size: .76rem; font-weight: 600; color: #3a3a3a; }
.hd-back, .hd-csv { white-space: nowrap; padding: .45rem .75rem; font-size: .78rem; }
.hd-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1rem .4rem; }
.hd-tools input[type=search] { flex: 1 1 240px; max-width: 420px; padding: .45rem .65rem; font-size: .85rem; border: 2px solid var(--hh-charcoal, #121212); border-radius: 8px; }
.hd-facets { display: flex; flex-wrap: wrap; gap: .3rem; }
.hd-facet { font-size: .7rem; padding: .25rem .55rem; border-radius: 999px; background: #fff; opacity: .55; }
.hd-facet.on { opacity: 1; background: #fff; color: var(--hh-charcoal, #121212); box-shadow: inset 0 -3px 0 var(--hh-yellow, #FFC700); }
.hd-facet b { margin-left: .2rem; }
.hd-count { margin-left: auto; font-size: .78rem; font-weight: 700; }
.hd-missing { margin: .3rem 1rem; background: #fff; border: 2px solid #b0001f; color: #8a0018; border-radius: 10px; padding: .45rem .7rem; font-size: .78rem; font-weight: 600; }
.hd-note { margin: .3rem 1rem; background: #fff; border: 2px solid #9a6700; color: #5a3d00; border-radius: 10px; padding: .45rem .7rem; font-size: .76rem; font-weight: 600; }
.hd-table { padding: .3rem 1rem 1rem; overflow: auto; }
.hd-table table { width: 100%; border-collapse: collapse; font-size: .8rem; background: #fff; border: 2px solid var(--hh-charcoal, #121212); }
.hd-table thead th { position: sticky; top: 0; background: var(--hh-charcoal, #121212); color: #fff; text-align: left; padding: .45rem .55rem; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.hd-table thead th.sort-asc::after { content: " ▲"; } .hd-table thead th.sort-desc::after { content: " ▼"; }
.hd-table td { padding: .4rem .55rem; border-top: 1px solid rgba(18,18,18,.1); vertical-align: top; white-space: nowrap; }
.hd-table td.wrap { white-space: normal; min-width: 220px; max-width: 520px; }
.hd-table tbody tr:nth-child(even) td { background: transparent; }
.hd-table tbody tr td { border-bottom: 1px solid rgba(18,18,18,.12); }
.hd-table tbody tr:hover td { box-shadow: inset 0 -1.5px 0 rgba(18,18,18,.4); }
.hd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hd-table tfoot td { font-weight: 800; border-top: 2px solid var(--hh-charcoal, #121212); background: transparent; }
.hd-table td.bad, .hd-table tr.na td { color: #8a0018; }
.hd-table tr.na td { font-style: italic; }
.hd-table td.good { color: #2E7D32; }
.hd-link { color: inherit; text-decoration: underline dotted; }
.hd-empty, .hd-loading { padding: 2rem; text-align: center; color: #5a5a5a; font-weight: 600; }
.hd-empty.na { color: #8a0018; }
.hd-cap { padding: .5rem; font-size: .74rem; color: #5a5a5a; text-align: center; }
@media (max-width: 720px) {
  .hd-overlay { padding: 0; }
  .hd-page { border-radius: 0; border-width: 0; box-shadow: none; min-height: 100vh; }
  .hd-head { border-radius: 0; flex-wrap: wrap; }
  .hd-head h2 { font-size: 1.1rem; }
  .hd-titles { order: 3; flex-basis: 100%; }
  .hd-csv { margin-left: auto; }
  .hd-table { padding: .3rem .4rem 1rem; }
}
/* Wide store-day tables (Sales "Net sales" popup, 2.9.4): sticky Day/Date/Store, text-only status colours, scroll sideways */
.hd-table table.hd-wide { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.hd-page:has(table.hd-wide) { width: min(1880px, 100%); }
/* sticky columns stick to the scroll container's padding edge, so move the gutter outside it (margin, not padding) */
.hd-table:has(table.hd-wide) { padding-left: 0; padding-right: 0; margin: 0 1rem; }
.hd-table table.hd-wide td, .hd-table table.hd-wide th { padding: .38rem .45rem; }
.hd-table table.hd-wide thead th { white-space: normal; vertical-align: bottom; line-height: 1.15; min-width: 3.2rem; max-width: 6.2rem; letter-spacing: .02em; }
.hd-note details summary { cursor: pointer; }
.hd-table table.hd-wide .hd-stk { position: sticky; z-index: 1; background: #fff; box-sizing: border-box; }
.hd-table table.hd-wide thead th.hd-stk { background: var(--hh-charcoal, #121212); z-index: 3; }
.hd-table table.hd-wide .hd-stk1 { left: 0; width: 3.4rem; min-width: 3.4rem; max-width: 3.4rem; }
.hd-table table.hd-wide .hd-stk2 { left: 3.4rem; width: 5.4rem; min-width: 5.4rem; max-width: 5.4rem; }
.hd-table table.hd-wide .hd-stk3 { left: 8.8rem; width: 4.4rem; min-width: 4.4rem; max-width: 4.4rem; box-shadow: inset -2px 0 0 rgba(18,18,18,.35); }
.hd-table .t-green { color: #1b6e20; font-weight: 700; }
.hd-table .t-yellow { color: #9a6700; font-weight: 700; }
.hd-table .t-red { color: #b0001f; font-weight: 700; }
.hd-table .hd-sm { font-size: .72rem; font-weight: 600; }
.hd-table .hd-sep { color: var(--hh-muted, #5a5a5a); margin: 0 .2rem; }
.hd-table .hd-unav { color: var(--hh-muted, #5a5a5a); }
.hd-table .hd-dim { opacity: .45; }
.hd-table .hd-mark { font-size: .7rem; font-weight: 800; margin-left: .1rem; }
@media (max-width: 720px) {
  .hd-table:has(table.hd-wide) { margin: 0 .4rem; }
  .hd-table table.hd-wide { font-size: .74rem; }
  .hd-table table.hd-wide td, .hd-table table.hd-wide th { padding: .32rem .4rem; }
  .hd-table table.hd-wide .hd-stk1 { width: 2.7rem; min-width: 2.7rem; max-width: 2.7rem; }
  .hd-table table.hd-wide .hd-stk2 { left: 2.7rem; width: 4.1rem; min-width: 4.1rem; max-width: 4.1rem; }
  .hd-table table.hd-wide .hd-stk3 { left: 6.8rem; width: 3.6rem; min-width: 3.6rem; max-width: 3.6rem; }
}
