/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:        #eff4ff;
  --bg-sidebar:     #eff4ff;
  --bg-panel:       #e3ecff;
  --bg-card:        #ffffff;
  --bg-hover:       #dce8f9;
  --bg-selected:    #c9dbf5;
  --accent:         #15aad2;
  --accent-hover:   #0c8ab8;
  --text-primary:   #0c335a;
  --text-secondary: #575e70;
  --text-muted:     #8a92a6;
  --border:         rgba(12,51,90,0.10);
  --border-strong:  rgba(12,51,90,0.18);
  --r-critical:     #dc2626;
  --r-high:         #ea580c;
  --r-medium:       #d97706;
  --r-low:          #16a34a;
  --shadow:         0 4px 20px rgba(12,51,90,0.12);
  --shadow-card:    0 2px 8px  rgba(12,51,90,0.07);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.header {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  box-shadow: var(--shadow-card);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #0c335a);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo-text { line-height: 1.2; }
.logo-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header-disclaimer {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(217,119,6,0.07);
  border: 1px solid rgba(217,119,6,0.22);
  border-radius: 6px;
  padding: 5px 14px;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.header-disclaimer strong { color: #b45309; font-weight: 600; }

.btn-cta {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(21,170,210,0.35);
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 296px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-heading {
  padding: 14px 18px 11px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.profile-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.profile-list::-webkit-scrollbar { width: 3px; }
.profile-list::-webkit-scrollbar-thumb {
  background: rgba(12,51,90,0.2);
  border-radius: 3px;
}

/* ===== PROFILE ITEM ===== */
.profile-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px 9px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
  user-select: none;
}
.profile-item:hover { background: var(--bg-hover); }
.profile-item.active {
  background: var(--bg-selected);
  border-left-color: var(--accent);
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.av-critical { background: var(--r-critical); }
.av-high     { background: var(--r-high); }
.av-medium   { background: var(--r-medium); }
.av-low      { background: var(--r-low); }

.profile-info { flex: 1; min-width: 0; }
.profile-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.profile-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

/* ===== RISK BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.6;
}
.badge-critical { background: rgba(220,38,38,0.1);   color: var(--r-critical); border: 1px solid rgba(220,38,38,0.25); }
.badge-high     { background: rgba(234,88,12,0.1);   color: var(--r-high);     border: 1px solid rgba(234,88,12,0.25); }
.badge-medium   { background: rgba(217,119,6,0.1);   color: var(--r-medium);   border: 1px solid rgba(217,119,6,0.25); }
.badge-low      { background: rgba(22,163,74,0.1);   color: var(--r-low);      border: 1px solid rgba(22,163,74,0.25); }

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px;
}
.empty-state-inner { max-width: 340px; }
.empty-icon {
  font-size: 52px;
  margin-bottom: 20px;
  opacity: 0.25;
  display: block;
}
.empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.empty-state p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== CONTENT HEADER ===== */
.content-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.ch-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ch-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.ch-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.ch-country { font-size: 12px; color: var(--text-muted); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  align-items: flex-end;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-card);
  flex-shrink: 0;
}
.tab-btn {
  background: none;
  border: none;
  padding: 13px 4px;
  margin-right: 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn.tab-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== TAB PANELS ===== */
.panels {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Loading */
.loading-state {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-base);
  z-index: 5;
}
.loading-state.show { display: flex; }
.spinner {
  width: 34px;
  height: 34px;
  border: 2.5px solid rgba(12,51,90,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SERVICE INFO BANNER ===== */
.service-banner {
  flex-shrink: 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.sb-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.sb-body { flex: 1; min-width: 0; }
.sb-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-chip {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(21,170,210,0.12);
  color: var(--accent);
  border: 1px solid rgba(21,170,210,0.25);
}
.sb-chip-dark {
  background: rgba(12,51,90,0.1);
  color: var(--text-primary);
  border-color: rgba(12,51,90,0.2);
}
.sb-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}
.sb-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(21,170,210,0.08);
  border: 1px solid rgba(21,170,210,0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ===== JSON VIEWER ===== */
#panel-raw {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.json-viewer {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 22px 26px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Menlo', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
  background: #0d1117;
  color: #cdd6f4;
}
.json-viewer::-webkit-scrollbar { width: 6px; height: 6px; }
.json-viewer::-webkit-scrollbar-track { background: transparent; }
.json-viewer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.jk  { color: #7dd3fc; }
.js  { color: #86efac; }
.jn  { color: #fbbf24; }
.jb  { color: #c084fc; }
.jl  { color: #64748b; }

/* ===== ARGOS PANEL ===== */
#panel-argos {
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
  display: none;
}
#panel-argos::-webkit-scrollbar { width: 5px; }
#panel-argos::-webkit-scrollbar-thumb { background: rgba(12,51,90,0.2); border-radius: 4px; }

.argos-scroll-area {
  padding: 20px 24px 28px;
}

.argos-risk-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid;
}
.argos-risk-bar.critical { background: rgba(220,38,38,0.06);  border-color: rgba(220,38,38,0.22); }
.argos-risk-bar.high     { background: rgba(234,88,12,0.06);  border-color: rgba(234,88,12,0.22); }
.argos-risk-bar.medium   { background: rgba(217,119,6,0.06);  border-color: rgba(217,119,6,0.22); }
.argos-risk-bar.low      { background: rgba(22,163,74,0.05);  border-color: rgba(22,163,74,0.22); }

.risk-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.risk-info h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.risk-info p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

.argos-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-label::before {
  content: '';
  display: block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.label-green::before  { background: var(--accent); }
.label-purple::before { background: #7c3aed; }
.label-blue::before   { background: #2563eb; }
.label-orange::before { background: var(--r-high); }

.conclusion-text {
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--text-secondary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.info-cell label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.info-cell span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== FINDINGS GRID ===== */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  box-shadow: var(--shadow-card);
}
.finding-card.hit  { border-color: rgba(220,38,38,0.25);  background: rgba(220,38,38,0.04); }
.finding-card.miss { border-color: rgba(22,163,74,0.22);  background: rgba(22,163,74,0.04); }

.finding-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.hit  .finding-ico { background: rgba(220,38,38,0.1); }
.miss .finding-ico { background: rgba(22,163,74,0.1); }

.finding-body h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}
.finding-body span { font-size: 11px; font-weight: 500; }
.hit  .finding-body span { color: var(--r-critical); }
.miss .finding-body span { color: var(--r-low); }

/* ===== PEP HISTORY ===== */
.pep-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.pep-entry:last-child { border-bottom: none; padding-bottom: 0; }
.pep-entry:first-child { padding-top: 0; }

.pep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c3aed;
  flex-shrink: 0;
  margin-top: 5px;
}
.pep-position {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 2px;
}
.pep-dates { font-size: 11.5px; color: var(--text-muted); }
.pep-entry-right { flex-shrink: 0; }
.pill-active {
  font-size: 9px;
  font-weight: 700;
  color: var(--r-critical);
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.2);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-inactive {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(12,51,90,0.06);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== SOURCES ===== */
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.source-row:last-child { border-bottom: none; padding-bottom: 0; }
.source-row:first-child { padding-top: 0; }
.source-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.source-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(12,51,90,0.05);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== LISTS FOUND ===== */
.lists-found {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.list-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(12,51,90,0.05);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
}

/* ===== PDF DOWNLOAD ===== */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(21,170,210,0.08);
  border: 1px solid rgba(21,170,210,0.28);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 8px;
  font-family: inherit;
}
.btn-pdf:hover {
  background: rgba(21,170,210,0.15);
  box-shadow: 0 2px 12px rgba(21,170,210,0.25);
}

/* ===== COMING SOON ===== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  text-align: center;
}
.coming-soon .cs-icon { font-size: 48px; margin-bottom: 18px; opacity: 0.3; }
.coming-soon h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.coming-soon p { font-size: 13px; color: var(--text-muted); max-width: 260px; line-height: 1.65; }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(12,51,90,0.45);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: var(--shadow);
  animation: fadeUp 0.22s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(12,51,90,0.07);
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.modal-close:hover { background: rgba(12,51,90,0.12); color: var(--text-primary); }

.modal-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.modal-logo .logo-mark { width: 28px; height: 28px; font-size: 11px; }
.modal-logo span { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.modal h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.modal > p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 22px; line-height: 1.55; }

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus { border-color: var(--accent); }
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--text-muted); }

.btn-send {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 6px;
  font-family: inherit;
}
.btn-send:hover { background: var(--accent-hover); }

/* ===== MOBILE ===== */
.burger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,51,90,0.4);
  z-index: 15;
}

@media (max-width: 768px) {
  .burger { display: block; }
  .header-disclaimer { display: none; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    z-index: 18;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .findings-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }

  .argos-scroll-area { padding: 16px; }
  .service-banner { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .header { padding: 0 12px; gap: 10px; }
  .btn-cta { padding: 8px 12px; font-size: 12px; }
  .modal { padding: 22px; }
}
