/* One token set with the dashboard, so the two surfaces read as one product
   rather than two that happen to share a logo. */
:root {
  --bg:        #0d1120;
  --bg-raised: #111826;
  --bg-input:  #0a0e18;
  --bg-hover:  #192336;

  --text:       #dde8f4;
  --text-muted: #6e8399;
  --text-label: #354c60;

  --border:      #1a2a3e;
  --border-dark: #10192a;

  --teal:  #00faff;
  --green: #23a559;
  --yellow:#faa61a;
  --red:   #ed4245;
  --blue:  #4d7cff;

  --radius: 6px;
  --radius-md: 10px;
  --line: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }

/* the one centre line every band pads out to, so the topbar and the content
   share an edge at every width */
.line { width: 100%; max-width: var(--line); margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7,10,16,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand:hover { color: inherit; }
.brand-mark { height: 22px; width: auto; display: block; }
.brand-sub { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search { display: flex; gap: 8px; margin-left: auto; flex: 1 1 260px; max-width: 420px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 8px 12px; font-size: 13px;
}
.search input:focus { outline: none; border-color: var(--teal); }
.search button {
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.search button:hover { border-color: var(--teal); color: var(--teal); }

.shell { display: flex; gap: 28px; align-items: flex-start; padding-top: 24px; padding-bottom: 48px; }

.nav { display: flex; flex-direction: column; gap: 2px; width: 160px; flex: 0 0 160px; position: sticky; top: 82px; }
.nav a {
  padding: 8px 12px; border-radius: var(--radius); color: var(--text-muted);
  font-size: 13px; font-weight: 500;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.on { background: var(--bg-raised); color: var(--teal); }

.view { flex: 1 1 auto; min-width: 0; }

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 26px 0 10px; }
.muted { color: var(--text-muted); }
.sub { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.card .n { font-size: 24px; font-weight: 600; display: block; }
.card .k { color: var(--text-muted); font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select, .filters input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 7px 10px; font-size: 13px;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--teal); }

/* a wide table scrolls inside its own box. the page never scrolls sideways. */
.tablewrap {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow-x: auto; max-width: 100%;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-label); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border-dark); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.empty { padding: 30px 14px; text-align: center; color: var(--text-muted); }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted);
}
.pill.open      { color: #7aa2ff; border-color: rgba(122,162,255,0.4); }
.pill.full      { color: var(--blue); border-color: rgba(77,124,255,0.4); }
.pill.live      { color: var(--green); border-color: rgba(35,165,89,0.5); }
.pill.reporting { color: var(--yellow); border-color: rgba(250,166,26,0.4); }
.pill.completed { color: var(--teal); border-color: rgba(0,250,255,0.3); }

.unlinked { color: var(--text-label); font-style: italic; }
.tick { color: var(--green); font-size: 11px; }

.detail { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 24px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 13px; }
.kv > span:first-child { color: var(--text-muted); }

.team { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--bg-raised); }
.team.won { border-color: rgba(35,165,89,0.5); }
.team h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-muted); font-weight: 600; }
.team .who { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }

.shots { display: flex; flex-wrap: wrap; gap: 10px; }
.shots img { max-width: 100%; width: 240px; border-radius: var(--radius); border: 1px solid var(--border); display: block; }

.timeline { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.timeline .row { display: flex; justify-content: space-between; gap: 12px; }
.timeline .kind { color: var(--teal); }

.pager { display: flex; gap: 8px; margin-top: 14px; }
.pager button {
  background: var(--bg-raised); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager button:not(:disabled):hover { border-color: var(--teal); color: var(--teal); }

.note {
  border-left: 2px solid var(--border); padding-left: 12px;
  color: var(--text-muted); font-size: 12px; margin: 14px 0 0;
}

.foot { border-top: 1px solid var(--border); padding: 18px 0; color: var(--text-label); font-size: 12px; }
.foot .line { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 14px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; gap: 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; width: auto; flex: none; position: static; }
  .detail { grid-template-columns: minmax(0,1fr); }
  /* a stretched flex item will not shrink under its own min-content, and the
     table sets a min-width, so the column is given a width to resolve against
     instead. without this the whole page scrolls sideways on a phone rather
     than the table scrolling inside its box. */
  .view { width: 100%; }
}
@media (max-width: 560px) {
  .topbar-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .search { margin-left: 0; max-width: none; flex-basis: 100%; }
}
