/* The Etsy shops dashboard. Every colour comes from the shop being shown:
   dashboard.js sets these tokens from that shop's brand/brand.md. */
:root {
  --main: #4a4a5a;
  --second: #8a8aa0;
  --accent: #c0a060;
  --bg: #f6f6f8;
  --text: #24242c;
  --card: #ffffff;
  --muted: color-mix(in srgb, var(--text) 62%, var(--card));
  --line: color-mix(in srgb, var(--text) 12%, var(--card));
  --soft: color-mix(in srgb, var(--main) 8%, var(--card));
  --soft-2: color-mix(in srgb, var(--second) 18%, var(--card));
  --warn: #9a5b00;
  --warn-bg: #fff3dc;
  --late: #a3262a;
  --late-bg: #fde8e8;
  --ok: #1f6f43;
  --ok-bg: #e2f4ea;
  --heading-font: ui-serif, Georgia, serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background-color .25s ease;
}
a { color: color-mix(in srgb, var(--main) 85%, black); text-underline-offset: 2px; }
h1, h2, h3, h4, h5 { font-family: var(--heading-font); line-height: 1.2; margin: 0 0 .5em; font-variant-numeric: lining-nums; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
h4 { font-size: 1rem; margin-top: 1em; }
p { margin: 0 0 .7em; }
ul, ol { margin: 0 0 .8em; padding-left: 1.3em; }
li { margin: .15em 0; }
code { font-size: .9em; background: var(--soft); padding: 0 .3em; border-radius: 4px; overflow-wrap: anywhere; }
.file-ref { border-bottom: 1px dotted var(--muted); }

.wrap, .top-inner, .glance, .tabs, main, .foot {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------- the top bar: this shop's colour, its logo, the switch */
.top { background: var(--main); color: var(--on-main, #fff); transition: background-color .25s ease; }
.top-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: #fff; object-fit: cover;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 80%, white);
}
.logo.initials {
  display: grid; place-items: center; padding: 0;
  font-family: var(--heading-font); font-weight: 700; font-size: 24px; color: var(--main);
}
.brand h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0; color: inherit; }
.brand .tagline { margin: 2px 0 0; opacity: .88; font-size: .92rem; }
.brand .tagline a { color: inherit; }

.switch {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(0, 0, 0, .18);
}
.switch button {
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 6px 14px 6px 6px;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  background: transparent; color: inherit; min-width: 0;
}
.switch .name-long { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch button:hover { background: rgba(255, 255, 255, .14); }
.switch button[aria-pressed="true"] { background: #fff; color: var(--text); }
.switch .mini {
  width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover;
  background: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; border: 2px solid var(--dot);
  color: var(--dot);
}
.switch button:focus-visible, .tabs button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* ---------- at a glance */
.glance {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
  margin-top: -1px; padding-top: 18px; padding-bottom: 4px;
}
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; border-top: 4px solid var(--second);
}
.tile .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile .value { font-variant-numeric: lining-nums tabular-nums; font-family: var(--heading-font); font-size: 1.7rem; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; }
.tile .sub { font-size: .88rem; color: var(--muted); }
.tile.alert { border-top-color: var(--warn); }

/* ---------- tabs */
.tabs { display: flex; gap: 6px; padding-top: 18px; padding-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--main); border-color: var(--main); color: var(--on-main, #fff); }

main { padding-top: 18px; padding-bottom: 32px; min-height: 50vh; }

/* ---------- cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.card > h2:first-child { margin-top: 0; }
.card .lede { color: var(--muted); font-size: .92rem; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty h2 { color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }

details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 600; color: color-mix(in srgb, var(--main) 85%, black); }
details.more[open] > summary { margin-bottom: 10px; }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap;
  background: var(--soft-2); color: var(--text);
}
.badge.sample { background: repeating-linear-gradient(135deg, var(--soft) 0 6px, var(--card) 6px 12px); border: 1px dashed var(--muted); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.late { background: var(--late-bg); color: var(--late); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.click { background: var(--accent); color: var(--text); }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- products board */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.column { background: color-mix(in srgb, var(--card) 55%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.column h3 { margin: 2px 4px 10px; font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; }
.column h3 .count { font-family: var(--body-font); font-size: .85rem; color: var(--muted); font-weight: 600; }
.column .none { color: var(--muted); font-size: .85rem; padding: 4px 6px 8px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.product > summary { list-style: none; cursor: pointer; padding: 12px; }
.product > summary::-webkit-details-marker { display: none; }
.product .thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: var(--soft); }
.product .p-name { font-weight: 700; line-height: 1.3; display: block; margin-bottom: 4px; }
.product .p-meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.progress { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.progress span { display: block; height: 100%; background: var(--second); border-radius: 999px; }
.product .p-next { font-size: .82rem; margin-bottom: 8px; }
.product .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.product .p-detail { border-top: 1px solid var(--line); padding: 12px; font-size: .88rem; background: color-mix(in srgb, var(--soft) 50%, var(--card)); }
.product .p-detail h4 { font-family: var(--body-font); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }
.product .p-detail h4:first-child { margin-top: 0; }
.facts { margin: 0; }
.facts dt { color: var(--muted); font-size: .76rem; }
.facts dd { margin: 0 0 6px; overflow-wrap: break-word; }
.facts dd.empty-val { color: var(--muted); font-style: italic; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 8px; align-items: center; }
.steps .tick { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--second); flex: none; display: grid; place-items: center; font-size: 10px; color: #fff; }
.steps li.done .tick { background: var(--second); }
.steps li.todo { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags span { font-size: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.tags span.long { border-color: var(--late); color: var(--late); }

/* markdown check lists from the files */
li.check { list-style: none; margin-left: -1.2em; }
li.check .tick { display: inline-block; width: 1.2em; color: var(--ok); }

/* ---------- calendar */
.when { white-space: nowrap; }
.when small { display: block; color: var(--muted); }

/* ---------- team */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.dept { margin: 0; display: flex; flex-direction: column; }
.dept h2 { font-size: 1.15rem; }
.teamie { border: 1px solid var(--line); border-left: 4px solid var(--second); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: color-mix(in srgb, var(--soft) 60%, var(--card)); }
.teamie .t-name { font-weight: 700; }
.teamie .badge { white-space: normal; }
.teamie .t-does { font-size: .86rem; color: var(--muted); margin: 2px 0 6px; }
.dept .not-yet { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.dept details.more { margin-top: auto; padding-top: 6px; font-size: .9rem; }

.foot { color: var(--muted); font-size: .82rem; padding-bottom: 28px; }
.foot .stale { color: var(--late); font-weight: 600; }

@media (max-width: 1000px) {
  .board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .board { grid-template-columns: 1fr; }
  .logo { width: 52px; height: 52px; }
  .switch { width: 100%; }
  .switch button { flex: 1; justify-content: center; padding-right: 10px; }
  .card { padding: 16px; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .switch button { font-size: .84rem; }
  .glance { grid-template-columns: 1fr 1fr; }
  .tile .value { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
