@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap");

:root {
  --bg: #edf3f7;
  --ink: #1b2634;
  --muted: #6a7888;
  --line: #d5dee7;
  --card: #ffffff;
  --accent: #355e7c;
  --accent-deep: #203f55;
  --critical: #b71c1c;
  --high: #ef6c00;
  --medium: #f6ad1a;
  --low: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% 6%, rgba(53, 94, 124, 0.17), transparent 35%),
    radial-gradient(circle at 5% 95%, rgba(15, 106, 137, 0.1), transparent 42%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.hero {
  background: linear-gradient(120deg, var(--accent-deep), var(--accent));
  color: #f3f8fc;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(32, 63, 85, 0.16);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.14);
  font-weight: 800;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.hero-kicker {
  margin: 0 0 6px;
  color: #cfe4f2;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#app-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

#app-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.95rem;
  color: #dcecf7;
  max-width: 74ch;
}

.hero-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,0.1);
}

.lang-switch,
.suite-links,
.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suite-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #f3f8fc;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  transition: 0.18s ease;
}

.suite-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.16);
}

.suite-link.active {
  background: #f7fbfe;
  color: var(--accent);
  border-color: transparent;
}

.lang-btn,
.tab,
button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.lang-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.lang-btn.active {
  background: #f7fbfe;
  color: var(--accent);
}

.tab {
  background: rgba(255,255,255,0.12);
  color: #f3f8fc;
  border: 1px solid rgba(255,255,255,0.14);
  white-space: nowrap;
}

.tab.active {
  background: #f7fbfe;
  color: var(--accent);
  border-color: transparent;
}

.main-grid {
  display: grid;
  gap: 12px;
}

.view {
  display: none;
  gap: 12px;
}

.view.active {
  display: grid;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-head h2 {
  margin: 0;
  font-size: 23px;
}

.help-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(32, 63, 85, 0.05);
}

.panel h3 {
  margin: 0 0 10px 0;
  font-size: 17px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid #dce5ed;
  border-radius: 12px;
  background: #fafcff;
  padding: 12px;
}

.kpi .k {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.kpi .v {
  font-size: 30px;
  font-weight: 800;
  margin-top: 4px;
}

.kpi.snapshot-kpi .v {
  font-size: clamp(1.15rem, 2vw, 1.85rem);
  line-height: 1.12;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 8px 7px;
  border-bottom: 1px solid #e7edf3;
  vertical-align: top;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.form-panel label,
.form-inline label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type="file"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
  background: #fff;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.secondary {
  background: #f7fbfe;
  color: var(--accent-deep);
  border-color: #dce5ed;
}

.muted {
  font-size: 13px;
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 7px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 34px;
  gap: 8px;
  align-items: center;
}

.bar-track {
  background: #e8eef4;
  border-radius: 999px;
  overflow: hidden;
  height: 12px;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.badge {
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  font-weight: 700;
}

.badge.critical { background: var(--critical); }
.badge.high { background: var(--high); }
.badge.medium { background: var(--medium); color: #2a2414; }
.badge.low { background: var(--low); }

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-card {
  border: 1px solid #dce5ed;
  border-radius: 12px;
  padding: 12px;
  background: #fafcff;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecf3f8;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 16, 0.42);
  display: grid;
  place-items: center;
  z-index: 50;
}

.help-modal.hidden {
  display: none;
}

.help-content {
  width: min(90vw, 440px);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
}

.help-content h3 {
  margin: 0 0 8px 0;
}

@media (max-width: 980px) {
  .split-grid {
    grid-template-columns: 1fr;
  }

  #app-subtitle {
    display: none;
  }
}
