/* Sidiora Labs stats dashboard — DARK theme.
   Palette and typography are taken from the supplied design tokens in
   .scss/base.css (.deepai--dark block, lines 159-298). */

:root {
  color-scheme: dark;
  /* Surfaces (from .deepai--dark) */
  --surface: #121317;
  --on-surface: #f8f9fc;
  --on-surface-variant: #b2bbc5;
  --container: #18191d;
  --container-high: #212226;
  --container-higher: #2f3034;
  --container-highest: #45474d;
  --outline: rgba(230, 234, 240, 0.12);
  --outline-variant: rgba(230, 234, 240, 0.06);
  /* Data-viz palette (from .deepai--dark) */
  --data-blue: #3c90ff;
  --data-blue-high: #9dd2ff;
  --data-blue-low: #2b4fda;
  --data-green: #0ebc5f;
  --data-green-high: #9be69a;
  --data-pink: #ff69c3;
  --data-yellow: #ffcf03;
  --data-red: #ff4c45;
  --data-purple: #6a64fd;
  --data-grey: #cdd4dc;
  /* Brand accent: the blue of the Sidiora sphere logo */
  --accent: #3c90ff;
  --radius: 14px;
  --font: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-code: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--data-blue-high); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 19, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-surface); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text > span { font-weight: 300; letter-spacing: 0.35em; font-size: 0.7rem; color: var(--on-surface-variant); }
.brand-text small { color: var(--on-surface-variant); font-size: 0.8rem; margin-top: 3px; letter-spacing: 0; }
.header-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-text { color: var(--on-surface-variant); font-size: 0.88rem; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 700; color: var(--data-green-high); border: 1px solid var(--outline); padding: 4px 11px; border-radius: 999px; background: var(--container); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--data-green); animation: pulse 2s infinite; }
.live.is-stale { color: var(--data-yellow); }
.live.is-stale .live-dot { background: var(--data-yellow); animation: none; }
.live.is-error { color: #ffacc2; }
.live.is-error .live-dot { background: var(--data-red); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14, 188, 95, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(14, 188, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 188, 95, 0); } }
.refresh-bar { height: 3px; background: var(--outline-variant); }
.refresh-bar-fill { height: 100%; width: 0%; background: var(--data-blue); transition: width 1s linear; }

/* Logo: source art is a blue sphere on black; a circular crop + zoom
   fills the disc with the sphere and drops the black corners. */
.logo-disc { display: inline-flex; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; background: #000; }
.logo-disc img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.42); }
.logo-disc-lg { width: 96px; height: 96px; }
.logo-disc-sm { width: 38px; height: 38px; }

.btn { font: inherit; font-size: 0.9rem; font-weight: 600; border-radius: 999px; padding: 8px 16px; cursor: pointer; border: 1px solid var(--outline); display: inline-block; }
.btn:hover { text-decoration: none; }
.btn-ghost { background: var(--container-high); color: var(--on-surface); }
.btn-ghost:hover { background: var(--container-higher); }
.btn-ghost:disabled { opacity: 0.55; cursor: wait; }
.btn-solid { background: var(--on-surface); color: var(--surface); border-color: var(--on-surface); }
.btn-solid:hover { background: #e1e6ec; }

/* ---- Sections ---- */
main.wrap { padding-bottom: 56px; }
section { margin-top: 52px; }
.section-head { margin-bottom: 20px; }
.section-head p { color: var(--on-surface-variant); margin-top: 6px; max-width: 62ch; }
.banner { margin-top: 22px; border: 1px solid rgba(255, 76, 69, 0.45); background: rgba(153, 13, 14, 0.25); color: #ffeef7; border-radius: var(--radius); padding: 14px 18px; font-size: 0.95rem; }
.banner.is-warn { border-color: rgba(255, 207, 3, 0.4); background: rgba(158, 61, 2, 0.22); color: #fcffad; }

/* ---- Org head ---- */
.org-head { display: flex; gap: 22px; align-items: center; margin-top: 36px; background: var(--container); border: 1px solid var(--outline); border-radius: 20px; padding: 26px; flex-wrap: wrap; }
.org-head-main { flex: 1 1 320px; min-width: 0; }
.org-head-main h1 { font-size: 2.1rem; font-weight: 750; }
.org-desc { color: var(--on-surface-variant); font-size: 1.05rem; margin-top: 6px; }
.org-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 0.9rem; color: var(--on-surface-variant); }
.org-meta b { color: var(--on-surface); font-weight: 600; }
.org-head-side { display: flex; gap: 28px; }
.org-since { display: flex; flex-direction: column; }
.org-since span { font-size: 0.8rem; color: var(--on-surface-variant); }
.org-since strong { font-size: 1.15rem; }

/* ---- KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi { background: var(--container); border: 1px solid var(--outline); border-radius: var(--radius); padding: 20px; }
.kpi-label { font-size: 0.9rem; color: var(--on-surface-variant); font-weight: 600; }
.kpi-value { font-size: 2.4rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 0.87rem; color: var(--on-surface-variant); margin-top: 6px; }
.kpi-delta { font-size: 0.82rem; font-weight: 700; margin-top: 8px; }
.kpi-delta.up { color: var(--data-green-high); }
.kpi-delta.down { color: #ffacc2; }
.skeleton { color: transparent !important; background: var(--container-higher); border-radius: 8px; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---- Panels & charts ---- */
.panel { background: var(--container); border: 1px solid var(--outline); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel-sub { color: var(--on-surface-variant); font-size: 0.88rem; margin-top: 4px; }
.chart { margin-top: 16px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .axis { fill: var(--on-surface-variant); font-size: 11px; }
.chart .gridline { stroke: var(--outline-variant); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.panel-feed { margin-top: 14px; }
.panel-head-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 0.86rem; color: var(--on-surface-variant); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.empty-note { color: var(--on-surface-variant); font-size: 0.92rem; padding: 18px 0 6px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.9rem; }
.hbar-row .hbar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--container-higher); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--on-surface-variant); }

/* ---- Feed ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 0.86rem; font-weight: 600; background: var(--container-high); color: var(--on-surface-variant); border: 1px solid var(--outline); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.chip:hover { color: var(--on-surface); background: var(--container-higher); }
.chip.is-active { background: var(--on-surface); color: var(--surface); border-color: var(--on-surface); }
.feed { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { display: flex; gap: 13px; padding: 13px 2px; border-top: 1px solid var(--outline-variant); align-items: flex-start; }
.feed li:first-child { border-top: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--container-higher); }
.feed-main { flex: 1; min-width: 0; font-size: 0.95rem; }
.feed-main .who { font-weight: 650; color: var(--on-surface); }
.feed-detail { color: var(--on-surface-variant); font-size: 0.87rem; margin-top: 2px; overflow-wrap: anywhere; }
.feed-time { color: var(--on-surface-variant); font-size: 0.83rem; white-space: nowrap; padding-top: 2px; }
.feed-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 2px; white-space: nowrap; }
.feed-more { margin-top: 14px; }

/* ---- Repositories ---- */
.repo-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.control { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--on-surface-variant); }
.control.grow { flex: 1 1 240px; }
.control input, .control select {
  font: inherit; font-size: 0.95rem; font-weight: 400; color: var(--on-surface);
  background: var(--container); border: 1px solid var(--outline); border-radius: 10px; padding: 10px 12px;
}
.control input:focus, .control select:focus { outline: 2px solid var(--data-blue); outline-offset: 1px; }
.repo-count { color: var(--on-surface-variant); font-size: 0.9rem; margin: 14px 0 10px; }
.repo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.repo-card { background: var(--container); border: 1px solid var(--outline); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.repo-card:hover { border-color: rgba(230, 234, 240, 0.28); }
.repo-name { font-size: 1.06rem; font-weight: 700; overflow-wrap: anywhere; }
.repo-badges { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: 2px; }
.mini-badge { font-size: 0.7rem; font-weight: 700; color: var(--on-surface-variant); border: 1px solid var(--outline); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.repo-desc { color: var(--on-surface-variant); font-size: 0.92rem; flex: 1; }
.repo-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topic { font-size: 0.76rem; font-weight: 600; color: var(--data-blue-high); background: rgba(43, 79, 218, 0.28); border-radius: 999px; padding: 2px 9px; }
.repo-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.87rem; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.repo-stats b { color: var(--on-surface); font-weight: 650; }
.lang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }

/* ---- People ---- */
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--outline-variant); }
.person:first-of-type { border-top: 0; margin-top: 8px; }
.person .avatar { width: 40px; height: 40px; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 650; overflow-wrap: anywhere; }
.person-sub { color: var(--on-surface-variant); font-size: 0.84rem; }
.person-num { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.person-num small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--on-surface-variant); text-align: right; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 14px 8px; margin-top: 14px; }
.member-cell { text-align: center; color: var(--on-surface); font-size: 0.8rem; overflow-wrap: anywhere; }
.member-cell .avatar { width: 52px; height: 52px; margin-bottom: 5px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--outline); background: var(--container); }
.footer-inner { display: flex; gap: 16px; align-items: center; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; font-size: 0.92rem; }
.footer-inner > div { flex: 1 1 420px; }
.foot-note { color: var(--on-surface-variant); font-size: 0.85rem; margin-top: 4px; }

/* ---- Responsive (breakpoints follow the supplied media sheets) ---- */
@media (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .grid-2, .repo-grid { grid-template-columns: 1fr; }
  .org-head { padding: 20px; }
  .org-head-main h1 { font-size: 1.7rem; }
  .logo-disc-lg { width: 72px; height: 72px; }
  .kpi-value { font-size: 1.9rem; }
  .hbar-row { grid-template-columns: 104px 1fr 44px; }
  .feed-time { display: none; }
  .feed-detail .rel-inline { color: var(--on-surface-variant); }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
