:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #20243a;
  --border: #2a2d3e;
  --text: #e8eaf0;
  --muted: #6b7280;
  --au: #3b82f6;
  --au-bg: rgba(59,130,246,0.1);
  --sg: #34d399;
  --sg-bg: rgba(52,211,153,0.1);
  --us: #f59e0b;
  --us-bg: rgba(245,158,11,0.1);
  --done: #10b981;
  --blocked: #ef4444;
  --win: #a78bfa;
  --win-bg: rgba(167,139,250,0.1);
  --macro: #fb923c;
  --macro-bg: rgba(251,146,60,0.1);
  --fintech: #38bdf8;
  --fintech-bg: rgba(56,189,248,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.logo span { color: var(--muted); font-weight: 400; }
.header-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.divider { color: var(--border); }
#refresh-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
#refresh-btn:hover { border-color: var(--au); color: var(--au); }

/* ── Main layout ── */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Clocks row ── */
.clocks-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.clock-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
}
.clock-pill.au { background: var(--au-bg); border-color: rgba(59,130,246,0.3); color: var(--au); }
.clock-pill.sg { background: var(--sg-bg); border-color: rgba(52,211,153,0.3); color: var(--sg); }
.clock-pill.us { background: var(--us-bg); border-color: rgba(245,158,11,0.3); color: var(--us); }

/* ── Section ── */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-title { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.section-sub { font-size: 12px; color: var(--muted); }

/* ── Team cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  border-top: 2px solid var(--border);
}
.card.submitted { border-top-color: var(--done); }
.card.has-blocked { border-top-color: var(--blocked); }
.card.pending { opacity: 0.6; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.card-name { font-weight: 600; font-size: 14px; }
.card-loc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.card-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.card-badge.in { background: rgba(16,185,129,0.12); color: var(--done); }
.card-badge.pending { background: rgba(55,65,81,0.4); color: var(--muted); }

.card-rows { display: flex; flex-direction: column; gap: 8px; }
.card-row { display: flex; gap: 7px; align-items: flex-start; }
.ri { font-size: 11px; margin-top: 2px; flex-shrink: 0; width: 14px; }
.rc {}
.rl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
.rv { font-size: 12px; color: var(--text); line-height: 1.4; }
.rv.empty { color: var(--muted); font-style: italic; }
.rv.alert { color: #fca5a5; }

.handoff {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  margin-top: 3px;
}
.handoff.au { background: var(--au-bg); color: var(--au); border: 1px solid rgba(59,130,246,0.25); }
.handoff.us { background: var(--us-bg); color: var(--us); border: 1px solid rgba(245,158,11,0.25); }

.pending-text { color: var(--muted); font-size: 12px; font-style: italic; }

.handoff-tasks {
  list-style: none;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.handoff-tasks li {
  font-size: 12px;
  color: var(--text);
  padding-left: 12px;
  position: relative;
  line-height: 1.4;
}
.handoff-tasks li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 11px;
}

/* ── Suggestions ── */
.suggestions-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.suggestions-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.suggestions-title { font-size: 13px; font-weight: 700; }
.suggestions-sub { font-size: 12px; color: var(--muted); }
.suggestions-list { background: var(--bg); }
.sug-item {
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.sug-item:last-child { border-bottom: none; }
.sug-priority {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.sug-priority.high { background: var(--blocked); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.sug-priority.medium { background: var(--us); }
.sug-body { flex: 1; }
.sug-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.sug-client { font-size: 10px; padding: 1px 7px; border-radius: 8px; background: var(--au-bg); color: var(--au); font-weight: 600; }
.sug-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.sug-reason { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* ── Relay ── */
.relay-banner {
  background: linear-gradient(135deg, rgba(59,130,246,0.07), rgba(245,158,11,0.07));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.relay-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
#relay-items { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.relay-item { font-size: 13px; display: flex; gap: 7px; }
.rfrom { font-weight: 600; }
.rarrow { color: var(--muted); }
.rtext { color: var(--muted); }

/* ── Two-col ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Coverage ── */
.coverage-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.coverage-item:last-child { border-bottom: none; }
.cov-icon { font-size: 18px; flex-shrink: 0; }
.cov-body {}
.cov-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.cov-person { font-weight: 600; font-size: 13px; }
.cov-client {
  font-size: 10px; padding: 1px 7px; border-radius: 8px;
  background: var(--au-bg); color: var(--au);
}
.cov-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.cov-desc { font-size: 13px; line-height: 1.4; }
.cov-outlet { font-size: 12px; color: var(--win); margin-top: 2px; }
.cov-outlet a { color: var(--win); text-decoration: none; }
.cov-outlet a:hover { text-decoration: underline; }
.empty-state { color: var(--muted); font-size: 13px; font-style: italic; padding: 8px 0; }

/* ── Intel ── */
.intel-filters { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.ifilt {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
}
.ifilt:hover, .ifilt.active { border-color: var(--au); color: var(--au); background: var(--au-bg); }

.intel-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.intel-item:last-child { border-bottom: none; }
.intel-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.itag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 2px 7px; border-radius: 8px;
}
.itag.macro { background: var(--macro-bg); color: var(--macro); }
.itag.fintech { background: var(--fintech-bg); color: var(--fintech); }
.itag.client { background: var(--au-bg); color: var(--au); }
.itag.coverage { background: var(--win-bg); color: var(--win); }
.isource { font-size: 11px; color: var(--muted); }
.iheadline { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 3px; }
.iheadline a { color: var(--text); text-decoration: none; }
.iheadline a:hover { color: var(--au); }
.isummary { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ── Activity ── */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.act-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 10px;
}
.act-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.act-icon.coverage { background: var(--win-bg); }
.act-icon.pitch { background: var(--au-bg); }
.act-icon.meeting { background: var(--us-bg); }
.act-icon.win { background: var(--win-bg); }
.act-icon.note { background: rgba(100,100,120,0.15); }

.act-body {}
.act-meta { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; flex-wrap: wrap; }
.act-person { font-weight: 600; font-size: 12px; }
.act-client { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--au-bg); color: var(--au); }
.act-time { font-size: 10px; color: var(--muted); margin-left: auto; }
.act-desc { font-size: 12px; color: var(--text); line-height: 1.4; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  main { padding: 16px 16px 48px; }
  .header-inner { padding: 12px 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .activity-grid { grid-template-columns: 1fr; }
}
