/* Board-specific additions on top of the shared SudoRender admin design system
   (css/style.css, copied from pss-licensing). Everything here uses the system's
   variables — no new palette, no new fonts. */

/* The `hidden` attribute must actually hide things.
   The UA stylesheet's [hidden] { display: none } is an attribute selector, so
   ANY class that sets display beats it — and .login-container sets
   display: flex. That left the signed-out card on screen after login, sitting
   over a board that had correctly unhidden itself behind it. */
[hidden] { display: none !important; }

.board-table td { vertical-align: top; }
.board-table tbody tr:hover { background: var(--bg-hover); }
.board-table tr.dim { opacity: .5; }

.prod-name { color: var(--name); font-weight: 600; }
.prod-repo { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.prod-repo a { color: var(--dim); text-decoration: none; }
.prod-repo a:hover { color: var(--accent); }

/* Semantic badge tints, reusing the system's status colours. */
.badge-ok   { color: var(--green);  border-color: var(--green-line);  background: var(--green-tint); }
.badge-warn { color: var(--yellow); border-color: var(--yellow-line); background: var(--yellow-tint); }
.badge-bad  { color: var(--red);    border-color: var(--red-line);    background: var(--red-tint); }
.badge-idle { color: var(--dim);    border-color: var(--border-mid);  background: transparent; }

.mkt-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 11.5px; }
.mkt-name { font-family: var(--mono); font-size: 10.5px; color: var(--label);
            text-transform: uppercase; letter-spacing: .5px; min-width: 92px; }
.mkt-mark { background: none; border: 0; color: var(--accent); cursor: pointer;
            font: 500 11px var(--font); padding: 0 2px; text-decoration: underline; }

.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions button { margin-left: 6px; }

.board-note { color: var(--dim); font-size: 12px; max-width: 68ch; margin-top: 16px; }
.status-line { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg2);
  color: var(--text); max-width: 620px; width: 92vw; padding: 26px;
}
dialog::backdrop { background: var(--backdrop); }
dialog textarea { width: 100%; min-height: 170px; resize: vertical; }
.dlg-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.dlg-foot .spacer { flex: 1; }

/* ---- Top navbar (this app has one page; no sidebar) ----
   The copied design system styles #app-header as a 224px x 100vh SIDEBAR,
   because in pss-licensing it is one. Using it as a top bar means undoing
   every geometric property, not just the colours: overriding background and
   border alone left a 224px column running down the left of the page with the
   board pushed below the fold. A later media query narrows it to 190px, which
   this also has to beat — publish.css loads after style.css, so equal
   specificity here wins on source order. */
#app-header {
  width: auto;
  min-width: 0;
  height: auto;
  display: block;
  overflow: visible;
  border-right: 0;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 12px; max-width: 1280px;
             margin: 0 auto; padding: 10px 34px; }
.nav-brand { color: var(--name); font-weight: 600; text-decoration: none; }

/* .btn-logout is width:100% in the design system because it fills the sidebar's
   account rail. There is no sidebar here, so it stretched across the navbar —
   and in the toolbar it made "Rescan all" claim the whole row, pushing "Add
   product" onto a line of its own. */
.btn-logout { width: auto; }
.nav-spacer { flex: 1; }
.nav-email { font-family: var(--mono); font-size: 11px; color: var(--dim); }
#app-header .app-switcher-menu { top: 34px; }

/* The design system centres the login card in a 100vh box, which overflows
   once a navbar sits above it. */
.login-container { height: auto; min-height: 68vh; }

/* ---- Summary strip: what needs you, before any row is read ---- */
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sum { font: 500 12px var(--font); padding: 6px 12px; border-radius: 8px;
       border: 1px solid var(--border-mid); background: var(--bg2); color: var(--muted); }
button.sum { cursor: pointer; }
button.sum:hover { border-color: var(--accent-line); }
.sum-warn { color: var(--yellow); border-color: var(--yellow-line); background: var(--yellow-tint); }
.sum-bad  { color: var(--red);    border-color: var(--red-line);    background: var(--red-tint); }
.sum-ok   { color: var(--green);  border-color: var(--green-line);  background: var(--green-tint); }
.sum-idle { color: var(--dim); }

/* ---- Rows: one line each, detail on demand ---- */
.col-caret { width: 26px; }
.col-actions { text-align: right; white-space: nowrap; width: 1%; }
.board-table tr.main { cursor: pointer; }
.board-table tr.main:hover { background: var(--bg-hover); }
.board-table tr.main.dim { opacity: .45; }
.board-table td { padding: 8px 12px; }
.caret { color: var(--dim); font-size: 11px; }
.prod-name { color: var(--name); font-weight: 600; }
.edit-prod { background: none; border: 0; color: var(--dim); cursor: pointer;
             font: 400 10.5px var(--mono); padding: 0 0 0 8px; opacity: 0; }
tr.main:hover .edit-prod { opacity: 1; }
.edit-prod:hover { color: var(--accent); }

/* ---- Expanded detail ---- */
tr.detail > td { background: var(--bg); border-bottom: 1px solid var(--border); padding: 4px 12px 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
               gap: 10px 24px; font-size: 12px; }
.dkey { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
        text-transform: uppercase; color: var(--label); margin-bottom: 3px; }
.detail-grid .src { font-size: 10.5px; margin-left: 6px; }
.mkt { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.mkt-name { font-family: var(--mono); font-size: 10px; text-transform: uppercase;
            letter-spacing: .5px; color: var(--label); }
.mkt-mark { background: none; border: 0; color: var(--accent); cursor: pointer;
            font: 500 10.5px var(--font); text-decoration: underline; padding: 0; }

/* ---- Product dialog ---- */
.field-grid { display: grid; grid-template-columns: 150px 1fr; gap: 10px 12px; align-items: center; margin-top: 12px; }
.field-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
               text-transform: uppercase; color: var(--label); }
.field-hint { font-size: 11.5px; margin-top: 6px; }
#prod-repo, #prod-status { width: 100%; }

/* ---- In-flight publish ---- */
.publishing { display: inline-flex; align-items: center; gap: 7px;
              font-size: 12px; color: var(--yellow); white-space: nowrap; }
.publishing a { color: var(--accent); }
.spinner { width: 11px; height: 11px; border-radius: 50%; flex: none;
           border: 2px solid var(--yellow-line); border-top-color: var(--yellow);
           animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Toast stack — the design system styles .toast but each app positions its own root. */
#toast-root { position: fixed; top: 16px; right: 18px; z-index: 60;
              display: flex; flex-direction: column; gap: 8px;
              pointer-events: none; align-items: flex-end; }

.scan-age { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
