/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f4f6f9;
  color: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
  background: #1f2937;
  color: white;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-brand h1 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.header-brand .tagline { font-size: 0.7rem; color: #9ca3af; display: block; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.user-chip { display: flex; align-items: center; gap: 0.6rem; }

.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #2563eb; color: white;
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-name { font-size: 0.8rem; color: #e5e7eb; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 6px; border: none;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
  line-height: 1;
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #374151; color: #e5e7eb; }
.btn-secondary:hover { background: #4b5563; }

/* ─── Tab Navigation ─────────────────────────────────────── */
.tab-nav {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 2rem;
  display: flex;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-btn {
  padding: 1rem 1.1rem;
  border: none; background: none;
  font-size: 0.875rem; color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab-btn:hover { color: #1f2937; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 500; }

/* ─── Content Area ───────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Landing (not logged in) ───────────────────────────── */
.landing-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}

.landing-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 2.5rem 3rem;
  width: 100%; max-width: 520px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  text-align: center;
}
.landing-card .lc-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.landing-card h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.landing-card p { color: #6b7280; font-size: 0.9rem; margin-bottom: 1.75rem; line-height: 1.65; }
.landing-card .btn { width: 100%; justify-content: center; padding: 0.75rem; font-size: 0.95rem; }

/* ─── Welcome Banner ─────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white; border-radius: 10px;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
}
.wb-left h2 { font-size: 1rem; font-weight: 600; color: white; margin: 0; }
.wb-left p { font-size: 0.8rem; color: rgba(255,255,255,0.75); margin: 0.2rem 0 0; }
.badge-verified {
  background: rgba(255,255,255,0.2); color: white;
  border-radius: 99px; padding: 0.3rem 0.85rem;
  font-size: 0.75rem; font-weight: 500;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.6rem; }
.card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; color: #1f2937; }
.card p { color: #4b5563; font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.4rem; }
.card li { color: #4b5563; font-size: 0.9rem; line-height: 1.75; }
.card ul, .card ol { padding-left: 1.25rem; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }

.grid-2 .card, .grid-3 .card, .grid-4 .card,
.grid-2 .box,  .grid-3 .box,  .grid-4 .box  { margin-bottom: 0; }

@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .two-col, .flow-compare { grid-template-columns: 1fr; }
  .risk-row { grid-template-columns: 1fr; }
}

/* ─── Two-column helper ──────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.two-col .card { margin-bottom: 0; }
.flow-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }

/* ─── Coloured Boxes ─────────────────────────────────────── */
.box {
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem; line-height: 1.65;
}
.box p  { font-size: 0.9rem; margin-bottom: 0.3rem; }
.box li { font-size: 0.9rem; line-height: 1.75; }
.box ul { padding-left: 1.2rem; }
.box strong { display: block; margin-bottom: 0.2rem; }

.box-blue   { background: #eff6ff; border-left: 4px solid #2563eb; color: #1e3a8a; }
.box-green  { background: #f0fdf4; border-left: 4px solid #16a34a; color: #14532d; }
.box-yellow { background: #fffbeb; border-left: 4px solid #d97706; color: #78350f; }
.box-red    { background: #fef2f2; border-left: 4px solid #dc2626; color: #7f1d1d; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 99px; font-size: 0.72rem; font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }

/* ─── Section Title ──────────────────────────────────────── */
.section-title {
  font-size: 1rem; font-weight: 600; color: #111827;
  margin-bottom: 0.875rem; margin-top: 0.25rem;
  display: block;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #f9fafb; text-align: left;
  padding: 0.65rem 0.875rem;
  font-size: 0.8rem; font-weight: 600; color: #374151;
  border-bottom: 2px solid #e5e7eb;
}
td {
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem; color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}
tr:last-child td { border-bottom: none; }

/* ─── Accordion ──────────────────────────────────────────── */
.accordion { margin-bottom: 1.25rem; }
details {
  border: 1px solid #e5e7eb;
  border-radius: 8px; overflow: hidden;
  margin-bottom: 0.45rem;
}
summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: #1f2937;
  background: #f9fafb; list-style: none;
  display: flex; align-items: center; gap: 0.5rem;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "▶"; font-size: 0.55rem; color: #6b7280;
  transition: transform 0.2s; flex-shrink: 0;
}
details[open] summary::before { transform: rotate(90deg); }
.detail-body {
  padding: 0.875rem 1rem;
  font-size: 0.875rem; color: #4b5563; line-height: 1.7;
  border-top: 1px solid #e5e7eb; background: white;
}

/* ─── Steps ──────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 0.875rem; }
.step { display: flex; gap: 0.875rem; align-items: flex-start; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2563eb; color: white;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.step-body h4 { font-size: 0.875rem; font-weight: 600; color: #111827; margin-bottom: 0.2rem; }
.step-body p  { font-size: 0.85rem; color: #4b5563; margin: 0; line-height: 1.6; }

/* ─── Risk Meter ─────────────────────────────────────────── */
.risk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.risk-card { border-radius: 8px; padding: 1.1rem; text-align: center; border: 1px solid; }
.risk-card h3 { font-size: 0.9rem; margin-bottom: 0.4rem; }
.risk-card p  { font-size: 0.8rem; margin: 0; line-height: 1.55; }
.risk-low    { background: #f0fdf4; border-color: #86efac; }
.risk-low h3 { color: #166534; }
.risk-medium { background: #fffbeb; border-color: #fcd34d; }
.risk-medium h3 { color: #92400e; }
.risk-high   { background: #fef2f2; border-color: #fca5a5; }
.risk-high h3 { color: #991b1b; }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.1rem;
  font-size: 0.78rem; color: #9ca3af;
  background: white;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}
