:root {
  --navy: #1a2744;
  --navy-light: #243560;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --red: #c0392b;
  --green: #27ae60;
  --purple: #8e44ad;
  --orange: #e67e22;
  --blue: #2980b9;
  --bg: #f5f5f0;
  --card: #ffffff;
  --text: #2c2c2c;
  --text-muted: #666;
  --border: #ddd;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Georgia, serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* AUTH */
#auth-screen {
  position: fixed; inset: 0; background: var(--navy);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.auth-box {
  background: white; border-radius: 8px; padding: 40px 48px; width: 360px;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.auth-box h1 { color: var(--navy); font-size: 22px; margin-bottom: 6px; }
.auth-box p { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-gold { color: var(--gold); font-size: 32px; margin-bottom: 12px; }
.auth-box input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 15px; margin-bottom: 12px; letter-spacing: 2px;
  font-family: Georgia, serif;
}
.auth-box input:focus { outline: none; border-color: var(--navy); }
.auth-box button {
  width: 100%; padding: 11px; background: var(--navy); color: white;
  border: none; border-radius: 6px; font-size: 15px; cursor: pointer; font-family: Georgia, serif;
}
.auth-box button:hover { background: var(--navy-light); }
.auth-error { color: var(--red); font-size: 13px; margin-top: 8px; display: none; }

/* HEADER / NAV */
header {
  background: var(--navy); color: white; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
header h1 { font-size: 18px; color: var(--gold-light); letter-spacing: 0.5px; }
header span { font-size: 12px; color: rgba(255,255,255,0.5); }

nav {
  background: var(--navy-light); display: flex; overflow-x: auto;
  border-bottom: 3px solid var(--gold);
}
nav button {
  padding: 12px 20px; color: rgba(255,255,255,0.7); background: none;
  border: none; cursor: pointer; font-size: 13px; font-family: Georgia, serif;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px;
  transition: all 0.2s;
}
nav button:hover { color: white; }
nav button.active { color: var(--gold-light); border-bottom-color: var(--gold); font-weight: bold; }

/* TABS */
.tab-content { display: none; padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-content.active { display: block; }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--card); border-radius: 8px; padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); text-align: center; border-top: 3px solid var(--navy);
}
.stat.critical { border-top-color: var(--red); }
.stat.warning { border-top-color: var(--gold); }
.stat.positive { border-top-color: var(--green); }
.stat-num { font-size: 28px; font-weight: bold; color: var(--navy); }
.stat.critical .stat-num { color: var(--red); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* CARDS */
.card { background: var(--card); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 16px; overflow: hidden; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 15px; color: var(--navy); }
.card-body { padding: 18px; }

/* KEY FACTS */
.key-fact {
  background: var(--card); border-radius: 8px; padding: 16px 18px;
  border-left: 4px solid var(--navy); margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.key-fact.red { border-left-color: var(--red); }
.key-fact.gold { border-left-color: var(--gold); }
.key-fact.green { border-left-color: var(--green); }
.key-fact h3 { font-size: 13px; font-weight: bold; color: var(--navy); margin-bottom: 4px; }
.key-fact.red h3 { color: var(--red); }
.key-fact p { font-size: 13px; color: var(--text-muted); }

/* SOURCES TABLE */
.sources-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sources-table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); background: #f5f5f0; }
.sources-table td { padding: 8px; border-bottom: 1px solid #eee; }

/* TIMELINE */
.timeline-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn {
  padding: 6px 14px; border: 1.5px solid var(--border); border-radius: 20px;
  background: white; cursor: pointer; font-size: 12px; font-family: Georgia, serif;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }

.period-header {
  background: var(--navy-light); color: var(--gold-light); padding: 8px 16px;
  font-size: 14px; font-weight: bold; border-radius: 6px; margin: 16px 0 8px;
  letter-spacing: 1px;
}

.tl-item {
  display: flex; margin-bottom: 8px;
  border-radius: 6px; overflow: hidden; border: 1px solid var(--border);
  background: var(--card);
}
.tl-item.critical { border-color: var(--red); background: #ffeaea; }
.tl-item.financial_claim { border-color: var(--purple); background: #f9f0ff; }
.tl-item.occupancy { border-color: var(--orange); background: #fff9e6; }
.tl-item.valuation { border-color: var(--blue); background: #e8f4fd; }

.tl-date {
  width: 90px; min-width: 90px; padding: 12px 10px; text-align: center;
  background: var(--navy); color: white; font-size: 11px; line-height: 1.4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tl-item.critical .tl-date { background: var(--red); }
.tl-item.financial_claim .tl-date { background: var(--purple); }
.tl-item.occupancy .tl-date { background: var(--orange); }
.tl-item.valuation .tl-date { background: var(--blue); }
.tl-day { font-size: 20px; font-weight: bold; }

.tl-body { padding: 12px 16px; flex: 1; }
.tl-source {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--navy); color: white; margin-bottom: 6px;
}
.tl-speaker { font-size: 11px; color: var(--text-muted); float: right; }
.tl-event { font-weight: bold; font-size: 14px; color: var(--navy); margin-bottom: 4px; }
.tl-item.critical .tl-event { color: var(--red); }
.tl-item.financial_claim .tl-event { color: var(--purple); }
.tl-summary { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.tl-quote {
  font-style: italic; font-size: 13px; color: #444; background: rgba(0,0,0,0.04);
  border-left: 3px solid var(--gold); padding: 6px 10px; border-radius: 2px;
}

/* CLAIMS */
.claim-card {
  border-radius: 8px; overflow: hidden; margin-bottom: 16px;
  border: 1.5px solid var(--border); background: var(--card);
}
.claim-card.critical { border-color: var(--red); }
.claim-header {
  background: var(--navy); color: white; padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.claim-card.critical .claim-header { background: var(--red); }
.claim-amount { font-size: 22px; font-weight: bold; color: var(--gold-light); }
.claim-badge { font-size: 11px; padding: 2px 10px; border-radius: 12px; background: rgba(255,255,255,0.2); }
.claim-source-label { font-size: 13px; margin-top: 4px; opacity: 0.8; }
.claim-body { padding: 16px 18px; }
.claim-context { font-size: 13px; margin-bottom: 8px; }
.claim-quote {
  font-style: italic; background: #f9f9f9; border-left: 3px solid var(--gold);
  padding: 10px 14px; border-radius: 2px; font-size: 13px; margin: 10px 0;
}
.claim-note { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.contradiction {
  background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px;
  padding: 10px 14px; font-size: 13px; margin-top: 8px;
}
.contradiction-label { font-weight: bold; }

/* EVIDENCE */
.evidence-item {
  border-radius: 8px; overflow: hidden; margin-bottom: 12px;
  border: 1px solid var(--border); background: var(--card);
}
.evidence-hdr { color: white; padding: 10px 16px; font-size: 13px; font-weight: bold; }
.evidence-hdr.red { background: var(--red); }
.evidence-hdr.purple { background: var(--purple); }
.evidence-hdr.blue { background: var(--blue); }
.evidence-hdr.green { background: var(--green); }
.evidence-body { padding: 14px 16px; }
.evidence-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.evidence-quote {
  font-style: italic; font-size: 14px; border-left: 3px solid var(--gold);
  padding: 8px 12px; background: #f9f9f9; border-radius: 2px; margin-bottom: 8px;
}
.evidence-context { font-size: 12px; color: var(--text-muted); }

/* SOT */
.sot-wrapper { background: var(--card); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; }
.sot-top { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sot-top h2 { font-size: 15px; color: var(--navy); }
.sot-alert {
  background: #fffbcc; border: 1px solid #e6d800; padding: 10px 14px;
  font-size: 12px; color: #5c4a00; margin: 0 18px;
}
.sot-body { padding: 20px 24px; font-size: 14px; line-height: 1.8; }
.sot-para { margin-bottom: 14px; }
.sot-num { font-weight: bold; color: var(--navy); }
.sot-heading {
  font-size: 15px; font-weight: bold; color: var(--navy);
  border-bottom: 2px solid var(--gold); padding-bottom: 4px; margin: 24px 0 12px;
}
.sot-em { font-style: italic; }
.sot-footer {
  text-align: center; padding: 16px; font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* PEOPLE */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.person-card {
  background: var(--card); border-radius: 8px; padding: 14px 16px;
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.person-name { font-weight: bold; color: var(--navy); font-size: 14px; }
.person-role { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* MISC */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px;
  font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-red { background: #fde; color: var(--red); }
.badge-navy { background: #e8ecf5; color: var(--navy); }
.badge-gold { background: #fff5dc; color: #a07800; }
.search-box {
  width: 100%; padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: Georgia, serif;
  margin-bottom: 14px;
}
.search-box:focus { outline: none; border-color: var(--navy); }
.empty-msg { text-align: center; color: var(--text-muted); padding: 40px; font-style: italic; }
.intro-note { font-size: 13px; color: var(--text-muted); }

@media (max-width: 600px) {
  .tl-date { width: 72px; min-width: 72px; }
  .tl-day { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  header h1 { font-size: 15px; }
}
