/* Product HQ. Built from the design in docs/design/. No build step: this file is served as it is. */
:root {
  --bg: #F6F6F7; --panel: #FFFFFF; --line: #E4E4E7; --line-soft: #EFEFF1; --hover: #FAFAFF;
  --text: #18181B; --text-2: #3F3F46; --muted: #5B5B66; --field: #D4D4D8;
  --accent: #4338CA; --accent-dark: #312E81; --accent-soft: #EEF0FF; --link: #3730A3; --link-hover: #1E1B4B;
  --warn-bg: #FEF3C7; --warn: #92400E; --bad-bg: #FEE2E2; --bad: #991B1B; --ok-bg: #DCFCE7; --ok: #166534; --blue-bg: #E0E7FF; --blue: #3730A3;
  --bar: #6366F1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 232px; max-width: 260px; padding: 20px 14px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.brand b { display: block; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text-2); }
.nav a:hover { background: #F1F1F4; color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nav .c { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line-soft); }
.side-foot form { margin: 0; }
.err { color: var(--bad); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.crumb { font-size: 13px; color: var(--muted); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border: 1px solid var(--field); border-radius: 6px; background: var(--panel); color: var(--text); font: 500 13px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #A1A1AA; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; font-size: 14px; height: 38px; padding: 0 18px; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.link { border: 0; background: none; color: var(--link); padding: 0; height: auto; font-weight: 400; }
.ctl { height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: 6px; background: var(--panel); font: 14px Inter, system-ui, sans-serif; color: var(--text); max-width: 100%; }
textarea.ctl, .form .ctl { width: 100%; }
textarea.ctl { height: auto; padding: 8px 10px; resize: vertical; }
.ctl:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; height: 36px; font-size: 13px; color: var(--text-2); }
.search { display: flex; align-items: center; gap: 8px; height: 38px; width: 360px; max-width: 100%; padding: 0 12px; background: var(--panel); border: 1px solid var(--field); border-radius: 8px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 14px Inter, system-ui, sans-serif; background: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0; }
.filters .grow { flex: 1 1 240px; }
.filters .ctl { width: 100%; }
.bar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.views { display: flex; flex-wrap: wrap; gap: 8px; }
.view { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 1px solid var(--field); border-radius: 999px; background: var(--panel); font-weight: 500; font-size: 13px; color: var(--text-2); }
.view:hover { text-decoration: none; border-color: #A1A1AA; color: var(--text); }
.view.on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* Content */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .sub { margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.tile:hover { text-decoration: none; color: var(--text); border-color: #A1A1AA; }
.tile .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile.hot { border-color: #FCD34D; }
.tile.hot .v { color: var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.row .grow { flex: 1; min-width: 0; }
.row .when { width: 56px; flex: none; }
.row .who { width: 170px; flex: none; }
.row .sha { width: 64px; flex: none; color: var(--muted); font: 12px/1.9 ui-monospace, Menlo, monospace; }
.row .n { width: 44px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.empty { padding: 14px 0; color: var(--muted); border-top: 1px solid var(--line-soft); }
.bars { display: grid; grid-template-columns: minmax(100px, 150px) 1fr 40px; gap: 10px 12px; align-items: center; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--bar); min-width: 2px; }
.chip { display: inline-block; font-size: 12px; line-height: 1.5; padding: 1px 8px; border-radius: 999px; background: #F1F1F4; color: var(--text-2); white-space: nowrap; margin: 0 4px 2px 0; }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.blue { background: var(--blue-bg); color: var(--blue); }
.blocker { margin-top: 4px; font-size: 12px; color: var(--bad); }
.me { color: var(--warn); font-weight: 600; }
.flash { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash ul { margin: 0; padding-left: 18px; }

/* Tables */
.table { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFAFB; }
th a { color: inherit; }
th a:hover { color: var(--text); text-decoration: none; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
td.title a { color: var(--text); }
tr.group td { background: var(--bg); font-size: 13px; font-weight: 600; padding: 8px 12px; }
.prod { font-weight: 600; }

/* One product */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat.bad { border-color: #FCA5A5; } .stat.bad b { color: var(--bad); }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .form { flex: 1 1 360px; }
.split > .wide { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .lbl { font-size: 13px; font-weight: 500; color: var(--text-2); gap: 6px; }
.form .ctl { min-height: 38px; }
.form .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px -4px 6px; flex-wrap: wrap; }
.tab { padding: 10px 12px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.on { color: var(--accent-dark); border-color: var(--accent); font-weight: 600; }

/* Log in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 720px) {
  .side { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 6px 10px; }
  .main { padding: 20px 16px 40px; }
  .row .who { width: 120px; }
}

/* A long chip in a table column wraps instead of widening the table. */
.chip.wrap { white-space: normal; border-radius: 8px; }
