* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #1a2b3c;
  margin: 0;
  padding: 0;
}
header {
  background: #1a3a5c;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
header h1 { font-size: 1.25rem; margin: 0; }
.header-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav a { color: #9fc6e8; text-decoration: none; font-size: 0.85rem; margin-left: 1rem; }
nav a:hover, nav a.active { color: white; font-weight: 600; }
#user-badge { font-size: 0.8rem; color: #cfe3f7; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.auth-gate {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f4f6f8;
}
.auth-card {
  background: white; border-radius: 12px; padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); text-align: center; max-width: 420px;
}
.auth-card h1 { margin-top: 0; font-size: 1.3rem; }
.banner {
  background: #fff3cd; border: 1px solid #ffe69c; color: #664d03;
  padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.85rem; margin-bottom: 1.5rem;
}
.stats-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat-box {
  background: white; border: 1px solid #dfe6ec; border-radius: 8px;
  padding: 0.9rem 1.2rem; min-width: 120px;
}
.stat-box .num { font-size: 1.6rem; font-weight: 700; color: #1e72b8; }
.stat-box .label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; }
.filters { margin-bottom: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.filters a {
  display: inline-block; padding: 0.35rem 0.8rem; border-radius: 16px;
  background: white; border: 1px solid #dfe6ec; color: #1a3a5c;
  text-decoration: none; font-size: 0.82rem; cursor: pointer;
}
.filters a.active { background: #1e72b8; color: white; border-color: #1e72b8; }
.filters select {
  padding: 0.35rem 0.6rem; border-radius: 6px;
  background: white; border: 1px solid #dfe6ec; color: #1a3a5c;
  font-size: 0.82rem; cursor: pointer; margin-left: 0.5rem;
}
.card {
  background: white; border: 1px solid #dfe6ec; border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: 0.9rem;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-title a { color: #1a3a5c; text-decoration: none; }
.card-sub { font-size: 0.8rem; color: #64748b; margin-top: 0.15rem; }
.badge {
  font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap;
}
.conf-high { background: #d1f0dd; color: #146c43; }
.conf-medium { background: #fff3cd; color: #997404; }
.conf-low { background: #f8d7da; color: #b02a37; }
.type-update { background: #cfe3f7; color: #1a3a5c; }
.type-new { background: #e2d9f3; color: #59359a; }
.type-confirm_no_change { background: #e9ecef; color: #495057; }
.type-flag_uncertain { background: #f8d7da; color: #b02a37; }
.diff-row { display: grid; grid-template-columns: 100px 1fr; gap: 0.5rem; margin: 0.6rem 0; font-size: 0.88rem; }
.diff-label { color: #64748b; }
.old-val { color: #b02a37; text-decoration: line-through; }
.new-val { color: #146c43; font-weight: 600; }
.source-box {
  background: #f4f6f8; border-left: 3px solid #1e72b8; padding: 0.6rem 0.9rem;
  margin-top: 0.6rem; font-size: 0.82rem; color: #3a4a5c;
}
.source-box a { color: #1e72b8; word-break: break-all; }
.reasoning { font-size: 0.82rem; color: #4a5a6c; margin-top: 0.5rem; font-style: italic; }
.actions { margin-top: 0.9rem; display: flex; gap: 0.5rem; }
.btn { padding: 0.45rem 1rem; border-radius: 6px; border: none; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.btn-approve { background: #146c43; color: white; }
.btn-reject { background: #b02a37; color: white; }
.btn-secondary { background: #e9ecef; color: #1a2b3c; }
.status-pill { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 600; }
.status-pending { background: #fff3cd; color: #997404; }
.status-approved { background: #d1f0dd; color: #146c43; }
.status-rejected { background: #f8d7da; color: #b02a37; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #eef1f4; }
th { color: #64748b; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.loading { text-align: center; color: #64748b; padding: 2rem; }

.docs-toc ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.docs-toc a { color: #1e72b8; text-decoration: none; font-size: 0.9rem; }
.docs-toc a:hover { text-decoration: underline; }
.docs-section { margin: 1.75rem 0; }
.docs-section h2 {
  font-size: 1.1rem; color: #1a3a5c; border-bottom: 2px solid #cfe3f7;
  padding-bottom: 0.4rem; margin-bottom: 0.75rem; scroll-margin-top: 1rem;
}
.docs-section p, .docs-section li { font-size: 0.92rem; line-height: 1.55; color: #2a3a4c; }
.docs-section ul, .docs-section ol { padding-left: 1.4rem; margin: 0.5rem 0; }
.docs-section li { margin-bottom: 0.4rem; }
