/* MSH retailer dashboard — design system lifted from MySellerHub (see ../../DESIGN.md) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F6F6F6;
  --surface: #FFFFFF;
  --sidebar: #1E1E1E;
  --sidebar-active: #343434;
  --sidebar-text: #9BA0B0;
  --text: #000000;
  --text-2: #5F6475;
  --text-3: #9BA0B0;
  --navy: #1F2B48;
  --line: #E9EEF2;
  --line-2: #D9D9D9;
  --line-3: #CFD9E8;
  --green: #089A36;
  --green-dark: #06792B;
  --teal: #0FAC7E;       /* kit button variant 3 */
  --green-tint: #E8FCEB;
  --green-tint-2: #E1FAE6;
  --blue: #0D61F8;
  --blue-tint: #EAF6FF;
  --sky-tint: #F3F7FF;
  --red: #FF6161;
  --red-tint: #FCE9E8;   /* Red/10 */
  --amber: #B7791F;      /* text on Yellow/20; the kit's Yellow/100 #F5C451 is used for the Publishing pill only */
  --yellow: #F5C451;     /* Yellow/100 */
  --amber-tint: #FFF5DE;
  --purple: #9747FF;
  --purple-tint: #F5EAFF;
  --neutral-tint: #E4E7EC;
  --mono: var(--font); /* Stan 2026-09-09: Poppins for digits too; tabular-nums keeps columns aligned */
  --r-control: 6px;
  --r-tile: 8px;
  --r-card: 14px;
  --shadow-pop: 0 12px 32px rgba(31, 43, 72, .14);
  --shadow-menu: 0 4px 7px rgba(0, 0, 0, .10);
  --rail: 70px;
  --rail-open: 260px;
  --topbar: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 500 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--text-2); }
.hint { color: var(--text-3); font-size: 12px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* --- layout ------------------------------------------------------------ */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  width: var(--rail); overflow: hidden;
  background: var(--sidebar); color: var(--sidebar-text);
  border-right: 1px solid var(--line-3);
  transition: width .18s ease;
  display: flex; flex-direction: column;
}
.rail:hover { width: var(--rail-open); box-shadow: var(--shadow-pop); }
.rail .brand {
  height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 19px;
  color: #fff; font-weight: 600; white-space: nowrap;
}
.rail .brand .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--green); display: grid; place-items: center; flex: 0 0 32px; color: #fff; font-weight: 700; font-size: 13px; }
.rail .brand span { opacity: 0; transition: opacity .12s; }
.rail:hover .brand span { opacity: 1; }
.nowrap { white-space: nowrap; }
.rail nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.rail nav a {
  display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 13px;
  border-radius: 8px; color: var(--sidebar-text); white-space: nowrap; font-weight: 500;
}
.rail nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.rail nav a.active { background: var(--sidebar-active); color: #fff; }
.rail nav a svg { width: 20px; height: 20px; flex: 0 0 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail nav a span { opacity: 0; transition: opacity .12s; }
.rail:hover nav a span { opacity: 1; }
.rail .bottom { margin-top: auto; }

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  margin-left: var(--rail); background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.topbar h1 { flex: 0 1 auto; min-width: 200px; }
.topbar .center { flex: 1; display: flex; justify-content: center; }
.topbar form.search {
  display: flex; align-items: center; gap: 8px; height: 36px; width: 340px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 200px; background: var(--surface);
}
.topbar form.search svg { width: 18px; height: 18px; stroke: var(--text-3); fill: none; stroke-width: 1.8; stroke-linecap: round; flex: 0 0 18px; }
.topbar form.search input { flex: 1; height: 32px; border: 0; padding: 0; background: transparent; font-size: 13px; }
.topbar form.search input:focus { outline: none; }
.topbar form.search .clear { color: var(--text-2); font-size: 12px; }
.topbar form.search .clear:hover { color: var(--red); text-decoration: none; }
/* account menu (Make 2026-09-08): avatar + name opens name/email/role, Settings, Users, Log out */
details.acct { position: relative; }
details.acct summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 3px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text);
}
details.acct summary::-webkit-details-marker { display: none; }
details.acct .avatar { width: 26px; height: 26px; border-radius: 6px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
details.acct .avatar.big { width: 38px; height: 38px; border-radius: 9px; font-size: 13px; }
details.acct .acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 260px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.13);
}
details.acct .who { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
details.acct .who .n { font-size: 14px; font-weight: 600; }
details.acct .who .e { font-size: 11px; color: var(--text-3); margin-top: 1px; }
details.acct .acct-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; font-size: 14px; color: var(--text); }
details.acct .acct-menu a:hover { background: var(--bg); text-decoration: none; }
details.acct .acct-menu a svg { width: 16px; height: 16px; stroke: var(--text-2); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
details.acct .acct-menu a.danger { color: var(--red); border-top: 1px solid var(--line); }
details.acct .acct-menu a.danger svg { stroke: var(--red); }

main.content { margin-left: var(--rail); padding: 20px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 767px) {
  .rail { position: static; width: 100%; height: auto; flex-direction: row; overflow-x: auto; }
  .rail:hover { width: 100%; box-shadow: none; }
  .rail .brand { display: none; }
  .rail nav { flex-direction: row; }
  .rail nav a span { opacity: 1; }
  .rail .bottom { margin-top: 0; }
  .topbar, main.content { margin-left: 0; }
}

/* --- cards, tiles, grids ---------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px 14px; }
.card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card > header .sub { color: var(--text-3); font-size: 12px; width: 100%; margin-top: -8px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile {
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--r-tile); background: var(--surface);
  color: inherit;
}
.tile:hover { text-decoration: none; border-color: var(--text-3); }
.tile .label { font-size: 14px; }
.tile .label small { display: block; color: var(--text-3); font-size: 12px; }
.tile .value { font-size: 28px; font-weight: 600; flex-shrink: 0; }
.tile.seg-A .value { color: var(--green); }
.tile.seg-D .value { color: var(--red); }

/* --- tables ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; background: var(--surface); }
table.t th { text-align: left; font-weight: 600; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-weight: 500; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.secondary, table.t .secondary { color: var(--text-2); }
table.t td.right, table.t th.right { text-align: right; }
table.t .sub { display: block; color: var(--text-3); font-size: 12px; font-weight: 500; }
table.t a.row-link { color: var(--text); font-weight: 500; }
table.t a.row-link:hover { color: var(--green); }
table.t.compact td, table.t.compact th { padding: 7px 10px; font-size: 13px; }

/* --- pills, badges ----------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 4px 12px; border-radius: var(--r-control); font-size: 14px; font-weight: 500; line-height: 1.245;
  background: var(--bg); color: var(--text-2);
}
.pill.wide { min-width: 110px; }
.pill.info { background: var(--blue-tint); color: var(--blue); }
.pill.ok { background: var(--green-tint); color: var(--green); }
.pill.warn { background: var(--amber-tint); color: var(--yellow); }
.pill.danger { background: var(--red-tint); color: var(--red); }
.pill.outline { background: transparent; border: 1px solid var(--red); color: var(--red); }
.pill.dark { background: var(--sidebar); color: #fff; }
.seg { min-width: 38px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.seg-A { background: var(--green-tint); color: var(--green); }
.seg-B2 { background: var(--blue-tint); color: var(--blue); }
.seg-B1 { background: var(--sky-tint); color: var(--navy); }
.seg-C { background: var(--neutral-tint); color: var(--text-2); }
.seg-D { background: var(--red-tint); color: var(--red); }
.flag { display: inline-flex; padding: 2px 7px; border-radius: 200px; background: var(--amber-tint); color: var(--amber); font-size: 12px; font-weight: 500; margin-right: 4px; white-space: nowrap; }
.flag.danger { background: var(--red-tint); color: var(--red); }
.flag.positive { background: var(--green-tint); color: var(--green); }
.flag.negative { background: var(--amber-tint); color: var(--amber); }
.delta { font-family: var(--mono); font-weight: 500; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); white-space: nowrap; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta::before { font-size: 9px; }
.delta.up::before { content: "▲"; }
.delta.down::before { content: "▼"; }

/* --- overview (layout from the Make prototype, MSH palette) --------------- */
.seg-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.seg-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: inherit; text-align: left; }
.seg-card:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.seg-card .top { display: flex; align-items: center; gap: 10px; }
.seg-card .badge { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 30px; }
.seg-card .lbl { flex: 1; font-size: 12px; line-height: 1.4; color: var(--text); }
.seg-card .count { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.seg-card .bottom { display: flex; align-items: center; justify-content: space-between; }
.seg-card .more { font-size: 11px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.seg-A .badge { background: var(--green-tint); color: var(--green); } .seg-B2 .badge { background: var(--blue-tint); color: var(--blue); }
.seg-B1 .badge { background: var(--sky-tint); color: var(--navy); } .seg-C .badge { background: var(--neutral-tint); color: var(--text-2); }
.seg-D .badge { background: var(--red-tint); color: var(--red); }
.kn td.value { font-family: var(--mono); font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
.pill.seg { font-family: var(--font); }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .title { font-size: 12px; font-weight: 500; }
.task-row .meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); margin-top: 3px; }
.tag { font-size: 10px; font-weight: 600; border-radius: 4px; padding: 1px 6px; letter-spacing: .02em; background: var(--neutral-tint); color: var(--text-2); }
.tag.new { background: var(--green-tint); color: var(--green); }
.tag.progress, .tag.today { background: var(--amber-tint); color: var(--amber); }
.tag.overdue { background: var(--red-tint); color: var(--red); }
.tag.me { background: var(--sky-tint); color: var(--navy); }

/* --- store card: left panel + tabs ------------------------------------------ */
.store-layout { display: grid; grid-template-columns: 20% 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .store-layout { grid-template-columns: 1fr; } }
.store-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.store-head .icon { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.07); display: grid; place-items: center; font-weight: 700; font-size: 20px; color: var(--green); flex: 0 0 56px; }
.store-head .name { font-size: 15px; font-weight: 700; line-height: 1.2; margin-bottom: 7px; }
.kv2 { display: flex; flex-direction: column; }
.kv2 .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.kv2 .row:last-child { border-bottom: 0; }
.kv2 .k { color: var(--text-3); flex-shrink: 0; }
.kv2 .v { color: var(--text); font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-title { font-size: 11px; font-weight: 600; letter-spacing: .02em; margin: 18px 0 8px; }
.tabs { display: flex; align-items: stretch; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 14px 18px; font-size: 13px; color: var(--text-3); border-bottom: 2px solid transparent; }
.tabs a svg { width: 14px; height: 14px; stroke: var(--line-2); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--green); }
.tabs a.active svg { stroke: var(--green); }
.lifecycle { display: flex; align-items: stretch; margin: 6px 0 16px; }
.lifecycle .stage { flex: 1; display: flex; flex-direction: column; gap: 5px; min-height: 62px; padding: 9px 12px; border: 1px solid var(--line); background: var(--bg); position: relative; color: var(--text-3); }
.lifecycle .stage:first-child { border-radius: 10px 0 0 10px; } .lifecycle .stage:last-child { border-radius: 0 10px 10px 0; }
.lifecycle .stage .head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; }
.lifecycle .stage .sub { font-size: 10px; padding-left: 35px; }
.lifecycle .stage .mini { display: inline-grid; place-items: center; width: 28px; height: 20px; border-radius: 5px; font-size: 10px; font-weight: 700; background: var(--neutral-tint); color: var(--text-3); border: 1px solid var(--line-2); }
.lifecycle .stage.past { background: #f6fef7; border-color: #bbf7d0; color: var(--green); }
.lifecycle .stage.past .mini { background: var(--green-tint); color: var(--green); border-color: #86efac; }
.lifecycle .stage.current { outline: 2px solid var(--green); outline-offset: -1px; z-index: 1; background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.lifecycle .stage.current.seg-D { outline-color: var(--red); background: var(--red-tint); color: var(--red); }
.lifecycle .stage.current .mini { background: var(--surface); color: inherit; border-color: currentColor; }
.lifecycle .stage.warn { background: #fff5f5; border-color: #fecaca; color: #f87171; }
.lifecycle .stage .cur { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; font-size: 9px; font-weight: 700; border-radius: 4px; padding: 2px 7px; letter-spacing: .06em; }
.lifecycle .stage.seg-D .cur { background: var(--red); }
.lifecycle .arrow { display: flex; align-items: center; color: var(--line-2); margin: 0 -1px; z-index: 2; font-size: 14px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 24px; font-size: 11px; color: var(--text-3); }
.meta-line b { color: var(--text); font-weight: 500; font-size: 12px; }
.split { display: grid; grid-template-columns: 65fr 35fr; gap: 12px; align-items: stretch; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.tl { display: flex; flex-direction: column; }
.tl .item { display: flex; gap: 12px; padding-bottom: 16px; }
.tl .item:last-child { padding-bottom: 0; }
.tl .spine { display: flex; flex-direction: column; align-items: center; width: 28px; flex: 0 0 28px; }
.tl .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--green-tint); border: 1px solid #bbf7d0; color: var(--green); font-size: 12px; }
.tl .ico.note { background: var(--bg); border-color: var(--line); color: var(--text-2); }
.tl .ico.system { background: var(--neutral-tint); border-color: var(--line); color: var(--text-3); }
.tl .line { width: 1px; flex: 1; background: var(--line); margin-top: 4px; }
.tl .body { flex: 1; padding-top: 4px; }
.tl .when { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tl .text { font-size: 12px; line-height: 1.55; color: var(--text); }
.tl .who { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.tasks-group .eyebrow { margin-bottom: 8px; }
.task-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #fafaf9; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
.task-card.overdue { background: #fff5f5; border-color: #fecaca; }
.task-card .title { font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.task-card .meta { font-size: 10px; color: var(--text-3); display: flex; gap: 8px; }
.task-card.overdue .meta .due { color: var(--red); }
.check { width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; color: var(--text-3); font-size: 12px; }
.check:hover { color: var(--green); border-color: var(--green); }
.stat-strip { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.stat-strip .stat { flex: 1; padding: 18px 20px; border-right: 1px solid var(--line); }
.stat-strip .stat:last-child { border-right: 0; }
.stat-strip .lbl { font-size: 11px; color: var(--text-3); font-weight: 500; margin-bottom: 8px; }
.stat-strip .val { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1; margin-bottom: 6px; }
.log-filters { display: flex; gap: 6px; }
.log-filters a { border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 13px; font-size: 11px; color: var(--text-2); }
.log-filters a.active { background: var(--text); color: #fff; border-color: var(--text); }
.log-filters a:hover { text-decoration: none; }
.log-day { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.log-day .line { flex: 1; height: 1px; background: var(--line); }
.log-entry { display: flex; gap: 14px; }
.log-entry .dot2 { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: 0 0 10px; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--text-3); background: var(--text-3); }
.log-entry.me .dot2 { background: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.log-entry.update .dot2 { background: var(--purple); box-shadow: 0 0 0 1.5px var(--purple); }
.log-entry .body { flex: 1; padding-bottom: 14px; }
.log-entry .head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 12px; font-weight: 600; }
.log-entry .head .time { margin-left: auto; font-size: 10px; color: var(--text-3); font-weight: 400; }
.log-entry .detail { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.src { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 1px 8px; font-size: 10px; font-weight: 600; border: 1px solid var(--line-2); background: var(--bg); color: var(--text-2); }
.src.me { background: var(--sky-tint); color: var(--navy); border-color: #bae6fd; }
.src.update { background: var(--purple-tint); color: var(--purple); border-color: #ddd6fe; }
.src.system { background: var(--neutral-tint); }
.form-inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 12px 14px; background: #fafaf9; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.form-inline label.field { flex: 1; min-width: 160px; }
.form-inline label.field.narrow { flex: 0 0 150px; min-width: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: middle; }
.dot.off { background: var(--text-3); }

/* --- controls ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 30px; padding: 0 12px;
  border-radius: var(--r-control); border: 1px solid var(--text); background: var(--text); color: #fff;
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #333; text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); }
.btn.secondary:hover { background: var(--bg); }
.btn.ghost { background: transparent; border-color: var(--line-3); color: var(--text); }
.btn.ghost:hover { background: var(--green-tint); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.green:hover { background: var(--green-dark); }
.btn.danger { background: var(--surface); border-color: var(--red); color: var(--red); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.teal { background: var(--surface); border-color: var(--teal); color: var(--teal); }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-control);
  background: var(--surface); font: 500 14px var(--font); color: var(--text); min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
label.field > input, label.field > select, label.field > textarea { font-size: 14px; color: var(--text); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line-3); border-radius: var(--r-control); background: var(--surface); font-size: 13px; color: var(--text);
}
.chip select { height: 26px; border: 0; padding: 0; background: transparent; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters input[type=text] { height: 30px; font-size: 13px; }
.filters .spacer { flex: 1; }
.filters .clear-all { font-size: 12px; font-weight: 500; color: var(--green); }
.filters .period-slot { display: inline-flex; align-items: center; margin-right: 28px; }
.chip.set { border-color: var(--green); background: var(--green-tint); }
.chip.set select { color: var(--green-dark); font-weight: 600; }
.chip .clear { color: var(--text-2); font-size: 12px; margin-left: 2px; padding: 0 2px; }
.chip .clear:hover { color: var(--red); text-decoration: none; }
.chip.search { padding: 0; border: 0; background: transparent; }
.chip.search input { height: 30px; width: 220px; }
.chip.search.set input { border-color: var(--green); }
.chip.period select { font-weight: 500; }
/* Figma-style filter dropdowns: button with caret, white panel with radio rows */
details.dd { position: relative; }
details.dd summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-weight: 500; font-size: 12px; white-space: nowrap;
}
details.dd summary::-webkit-details-marker { display: none; }
details.dd summary .dd-label b { color: var(--text); font-weight: 500; }
details.dd summary .caret { font-size: 11px; color: var(--text); }
details.dd[open] summary { border-color: var(--text); }
details.dd.set summary { border-color: var(--text-2); background: var(--surface); }
details.dd .dd-menu {
  position: absolute; top: 36px; left: 0; z-index: 30; min-width: 200px; padding: 6px 0; background: var(--surface);
  border-radius: 6px; box-shadow: 0 0 5px rgba(0,0,0,.10); display: flex; flex-direction: column; gap: 0;
}
details.dd.right .dd-menu { left: auto; right: 0; }  /* dropdowns at the right edge open leftwards */
.filters .dd-clear + details, .filters details.right { margin-right: 4px; }
details.dd .dd-item {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; margin: 0 4px; border-radius: 4px; color: var(--text); font-weight: 500; font-size: 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
details.dd .dd-item:last-child { border-bottom: 0; }
details.dd .dd-item:hover { background: var(--bg); text-decoration: none; }
details.dd .dd-item.selected { background: var(--sky-tint); color: var(--green); }
details.dd .dd-item .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-3); flex: 0 0 16px; position: relative; }
details.dd .dd-item.selected .radio { border-color: var(--green); }
details.dd .dd-item.selected .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--green); }
details.dd .dd-item .count { color: var(--text-3); font-size: 12px; }
details.dd .dd-level { display: flex; flex-direction: column; }
details.dd .dd-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
details.dd .dd-row .dd-item { flex: 1; border-bottom: 0; }
details.dd .dd-row:last-child { border-bottom: 0; }
details.dd .dd-more, details.dd .dd-back {
  background: transparent; border: 0; cursor: pointer; font: 600 16px/1 var(--font); color: var(--text-2); padding: 8px 10px; border-radius: 6px;
}
details.dd .dd-more:hover, details.dd .dd-back:hover { background: var(--bg); color: var(--text); }
details.dd .dd-back { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
details.dd .dd-menu { max-height: 420px; overflow-y: auto; }
table.t.prospects col.c-store { width: 24%; }
table.t.prospects col.c-cat { width: auto; }
details.dd summary .dd-clear { color: var(--text-2); font-size: 12px; line-height: 1; padding: 2px; margin-left: 2px; }
details.dd summary .dd-clear:hover { color: var(--red); text-decoration: none; }

/* equal column grid for list tables; long names get an ellipsis */
table.t.fixed { table-layout: fixed; }
table.t.fixed td.right, table.t.fixed th.right { text-align: left; }
table.t.stores col { width: auto; }
table.t.stores col.c-store { width: 24%; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
table.t td.store-cell a.row-link.ellipsis { max-width: 100%; }
th.sortable { white-space: nowrap; }
th.sortable .sort-arrows { color: var(--line-2); font-size: 8px; line-height: 1; text-decoration: none; margin-right: 1px; }
th.sortable .sort-arrows span.on { color: var(--green); }
th.sortable .sort-arrows:hover span { color: var(--text); }
th.sortable.active { color: var(--green-dark); }
form.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- key/value lists (order card style) ------------------------------ */
.kv { display: grid; grid-template-columns: max-content 1fr; column-gap: 16px; row-gap: 6px; font-size: 13px; }
.kv dt { color: var(--text-2); margin: 0; }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.kv.left dd { text-align: left; }
.card h3.section { margin: 14px 0 8px; font-size: 14px; }

/* --- misc -------------------------------------------------------------- */
.summary-line { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.timeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timeline .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-control); font-size: 12px; background: var(--surface); }
.timeline .arrow { color: var(--text-3); }
.empty { color: var(--text-3); padding: 24px 0; text-align: center; }
.login { max-width: 380px; margin: 12vh auto; }
.login .card { padding: 24px; }
.error { color: var(--red); font-size: 13px; }
.alert { padding: 10px 12px; border-radius: var(--r-control); background: var(--amber-tint); color: var(--amber); font-size: 13px; }

/* Shelf tab: share-of-shelf bar */
.bar { display: inline-block; vertical-align: middle; width: 72px; height: 6px; margin-right: 6px; border-radius: 3px; background: var(--neutral-tint); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* Metrics section */
.section-title { font-size: 13px; font-weight: 600; letter-spacing: .01em; margin: 22px 0 10px; }
/* Metrics page (2026-09-08): tiles in the store card's stat vocabulary — 11px label, 22px mono value */
.stat-strip .stat.result .val { color: var(--green); }
.stat-strip .tgt { font-size: 11px; color: var(--text-3); }
.stat-strip .tgt b { color: var(--text-2); font-weight: 500; }
.metrics-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mtile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.mtile.blocked { background: var(--bg); }
.mtile .lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-3); font-weight: 500; }
.mtile .lbl .tgt { font-size: 10px; white-space: nowrap; }
.mtile .lbl .tgt b { color: var(--text-2); font-weight: 500; }
.mtile .val { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1; margin-top: 2px; }
.mtile.blocked .val { color: var(--text-3); }
.mtile .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mtile .detail { font-size: 11px; color: var(--text-2); line-height: 1.45; }
.mtile .def { font-size: 10px; color: var(--text-3); line-height: 1.4; border-top: 1px solid var(--line); padding-top: 6px; margin-top: auto; }
ul.notes { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
ul.notes li { margin-bottom: 6px; }
ul.notes b { color: var(--text); }

/* Products and Orders lists (MSH design: listing cell with thumbnail + two lines) */
.listing-table td { vertical-align: middle; }
.listing-table .listing { min-width: 320px; }
.listing .cell { display: flex; align-items: center; gap: 16px; }
.listing .thumb { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; flex: 0 0 56px; background: var(--neutral-tint); display: block; }
.listing .thumb.empty { border: 1px solid var(--line); }
.listing .text { min-width: 0; }
.listing .name { font-weight: 500; font-size: 14px; line-height: 1.245; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.listing-table tr.order-more td { border-top: 0; }
.num.positive { color: var(--green); }
.tracking { font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--text-2); vertical-align: middle; }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.danger { background: var(--red); }
.dot.info { background: var(--blue); }
.dot.neutral { background: var(--black-40, #D9D9D9); }
.pill.neutral { background: var(--neutral-tint); color: var(--text-2); }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .glyph { font-size: 34px; color: var(--text-2); }
.empty-state h2 { font-size: 18px; margin: 12px 0 8px; }
.empty-state p { font-size: 13px; color: var(--text-2); max-width: 520px; margin: 0 auto 16px; line-height: 1.6; }

/* numeric range filter (Make 2026-09-08): chip opens min/max inputs and an Apply button */
details.dd.range .dd-menu { padding: 14px; min-width: 220px; gap: 10px; }
details.dd.range .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
details.dd.range .pair input { height: 32px; font-size: 12px; padding: 0 10px; border-radius: 8px; }
details.dd.range summary b { font-weight: 500; font-size: 11px; }

/* order card (Make 2026-09-08): 300px order panel on the left, items + summary on the right */
.order-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.order-summary { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); margin-left: auto; max-width: 300px; }
.order-summary .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 4px 0; }
.order-summary .row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 15px; font-weight: 600; color: var(--text); }
.kv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.kv-cols .kv2 .row { font-size: 12px; }
.danger-text { color: var(--red); }
.t td .sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
/* task row actions: ✓ done, ⋯ opens snooze / skip */
details.row-menu { position: relative; }
details.row-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: default; }
details.row-menu summary::-webkit-details-marker { display: none; }
details.row-menu .more { cursor: pointer; color: var(--text-3); font-size: 16px; line-height: 1; padding: 0 4px; }
details.row-menu .more:hover { color: var(--text); }
details.row-menu .row-menu-body { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
details.row-menu .row-menu-body input[type=text] { width: 140px; }
@media (max-width: 1100px) { .order-layout, .kv-cols { grid-template-columns: 1fr; } }
