/* ═══════════════════════════════════════════
   Dashboard NR-01 — Estilo alinhado ao formulário
   ═══════════════════════════════════════════ */

:root {
  --bg: #f4fbfb;
  --surface: #ffffff;
  --surface-soft: #eef8f7;
  --ink: #163039;
  --muted: #667987;
  --brand: #0d7d86;
  --brand-dark: #075d66;
  --brand-soft: #d9f4f1;
  --accent: #ec6f8f;
  --accent-soft: #ffe4eb;
  --line: #d6e7e6;
  --shadow: 0 24px 70px rgba(8, 64, 73, 0.16);
  --radius: 8px;

  --green: #059669;
  --green-soft: #d1fae5;
  --yellow: #d97706;
  --yellow-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(236, 111, 143, 0.18), transparent 28%),
    linear-gradient(135deg, #eaf8f7 0%, #fbfdfd 46%, #f8eef2 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* ═══ LOGIN — SPLIT LAYOUT ═══ */

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.1fr 0.9fr;
}

/* — Brand Panel (esquerda) — */

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 32px clamp(28px, 5vw, 72px);
  color: #f9ffff;
  background:
    linear-gradient(120deg, rgba(7, 93, 102, 0.96), rgba(11, 127, 134, 0.88)),
    linear-gradient(145deg, #065b63, #12a7a1);
  background-size: cover;
}

.login-topbar {
  position: relative;
  z-index: 2;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 16px;
}

.brand-lockup small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.login-brand-content {
  position: relative;
  z-index: 2;
  width: min(580px, 100%);
  padding: 80px 0 70px;
}

.eyebrow-light {
  color: #ffdbe5;
}

.login-hero-title {
  margin-bottom: 20px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
  color: #fff;
  background: none;
  -webkit-text-fill-color: unset;
}

.login-hero-text {
  max-width: 480px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.65;
}

.login-features {
  display: grid;
  width: min(440px, 100%);
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.login-features span {
  padding: 14px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.login-features span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* — Decorative Orbs — */

.login-visual {
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: min(42vw, 480px);
  aspect-ratio: 1;
  opacity: 0.8;
}

.orb, .orb-ring {
  position: absolute;
  border-radius: 50%;
}

.orb-one {
  inset: 10%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.6), transparent 20%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(236, 111, 143, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.orb-two {
  inset: 30%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
}

.orb-ring {
  inset: 2%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* — Login Panel (direita) — */

.login-panel {
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 32px clamp(20px, 4vw, 56px);
}

.login-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 36px);
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

h3 {
  font-size: 16px;
  font-weight: 800;
}

.subtitle, .meta {
  color: var(--muted);
  line-height: 1.55;
}

.subtitle {
  margin-bottom: 6px;
}

label {
  display: block;
  margin: 18px 0 6px;
  color: #314b55;
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfefe;
  color: var(--ink);
  outline: none;
  padding: 0 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #9aabb2;
}

input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 125, 134, 0.12);
}

.primary-button, .secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  transition: filter 120ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  box-shadow: 0 14px 26px rgba(13, 125, 134, 0.26);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button {
  padding: 0 22px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.secondary-button:hover {
  filter: brightness(0.96);
}

.form-message {
  min-height: 18px;
  margin-top: 14px;
  color: #b53655;
  font-size: 13px;
  font-weight: 700;
}

/* ═══ DASHBOARD SHELL ═══ */

.dashboard-shell {
  min-height: 100vh;
  padding: 28px clamp(20px, 3vw, 48px) 48px;
}

.dashboard-card {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

/* ═══ HEADER ═══ */

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dash-header .meta {
  margin-top: 4px;
  font-size: 13px;
}

/* ═══ STATUS GRID ═══ */

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfefe;
  padding: 14px 10px;
  text-align: center;
}

.status-grid strong {
  display: block;
  color: var(--brand-dark);
  font-size: 20px;
  line-height: 1.1;
}

.status-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ═══ TABS ═══ */

.dash-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab-button.active {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(8, 64, 73, 0.1);
}

.tab-button:not(.active):hover {
  color: var(--ink);
}

/* ═══ TAB CONTENT ═══ */

.tab-content {
  display: none;
}

.tab-content.active {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
  animation: fadeIn 250ms ease;
}

.tab-content .section-block.full {
  grid-column: 1 / -1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ SECTION BLOCK ═══ */

.section-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfefe;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ═══ GAUGE ═══ */

.gauge-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.gauge {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0deg, var(--brand) 0deg, var(--surface-soft) 0deg 360deg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.8s ease;
}

.gauge::before {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fbfefe;
  box-shadow: inset 0 1px 6px rgba(8, 64, 73, 0.08);
}

.gauge-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.gauge-inner strong {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1;
}

.gauge-inner span {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.gauge-text {
  flex: 1;
  min-width: 160px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ═══ BAR LIST (shared) ═══ */

.bar-list, .risk-list, .insight-list {
  display: grid;
  gap: 10px;
}

.bar-row, .level-row {
  display: grid;
  gap: 5px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.bar-top span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.level-row[data-level="Baixo"] .fill {
  background: linear-gradient(90deg, #059669, #34d399);
}

.level-row[data-level="Moderado"] .fill {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.level-row[data-level="Alto"] .fill {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

/* ═══ RISK ROW ═══ */

.risk-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 160ms ease;
}

.risk-row:hover {
  box-shadow: 0 6px 18px rgba(8, 64, 73, 0.08);
}

.risk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.risk-top span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.risk-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.risk-row:nth-child(-n+3) .fill {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.risk-row:nth-child(n+4):nth-child(-n+8) .fill {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

/* ═══ INSIGHTS ═══ */

.insight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 160ms ease;
}

.insight-item:hover {
  box-shadow: 0 6px 18px rgba(8, 64, 73, 0.08);
}

.insight-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}

.insight-rank.critical {
  background: var(--red-soft);
  color: var(--red);
}

.insight-rank.positive {
  background: var(--green-soft);
  color: var(--green);
}

.insight-content {
  flex: 1;
  min-width: 0;
}

.insight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.insight-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.insight-badge {
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.insight-badge.critical {
  background: var(--red-soft);
  color: var(--red);
}

.insight-badge.positive {
  background: var(--green-soft);
  color: var(--green);
}

/* ═══ CATEGORIES ═══ */

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

.category-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 160ms ease;
}

.category-card:hover {
  box-shadow: 0 6px 18px rgba(8, 64, 73, 0.08);
}

.category-emoji {
  font-size: 20px;
  margin-bottom: 8px;
}

.category-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.category-score {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.category-score.low { color: var(--green); }
.category-score.moderate { color: var(--yellow); }
.category-score.high { color: var(--red); }

.category-desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
  margin-top: 8px;
}

/* ═══ TIMELINE ═══ */

.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(30px, 1fr);
  align-items: end;
  min-height: 160px;
  gap: 3px;
  overflow-x: auto;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 140px;
}

.timeline-count {
  font-size: 10px;
  font-weight: 800;
  color: var(--brand-dark);
}

.timeline-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--brand));
}

.timeline-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  writing-mode: vertical-rl;
}

/* ═══ MANUAL ═══ */

.manual-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}

.manual-text p {
  margin-bottom: 12px;
}

.manual-text p:last-child {
  margin-bottom: 0;
}

.manual-text strong {
  color: var(--brand-dark);
}

.manual-text em {
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.manual-table th,
.manual-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.manual-table th {
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.manual-table td:last-child {
  text-align: center;
  font-weight: 800;
  color: var(--brand-dark);
}

.manual-table tbody tr:hover {
  background: var(--surface-soft);
}

.manual-note {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.55;
  color: var(--brand-dark);
}

.manual-levels {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.manual-level {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.manual-level p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.manual-level strong {
  font-size: 14px;
}

.level-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.manual-level.low .level-dot {
  background: var(--green);
}

.manual-level.low strong {
  color: var(--green);
}

.manual-level.moderate .level-dot {
  background: var(--yellow);
}

.manual-level.moderate strong {
  color: var(--yellow);
}

.manual-level.high .level-dot {
  background: var(--red);
}

.manual-level.high strong {
  color: var(--red);
}

.manual-glossary dl {
  display: grid;
  gap: 14px;
}

.manual-glossary dt {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-dark);
}

.manual-glossary dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.manual-glossary dd:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.manual-questions {
  padding-left: 22px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.manual-questions li::marker {
  color: var(--brand);
  font-weight: 800;
}

/* ═══ COMPANY REPORT ═══ */

.company-select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfefe;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23667987' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.company-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(13, 125, 134, 0.12);
}

.company-stats {
  grid-template-columns: repeat(4, 1fr);
}

.users-list {
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  transition: box-shadow 160ms ease;
}

.user-card:hover {
  box-shadow: 0 6px 18px rgba(8, 64, 73, 0.08);
}

.user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.user-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.user-cpf {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.user-assessments {
  display: grid;
  gap: 6px;
}

.assessment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfefe;
  font-size: 12px;
  font-weight: 700;
}

.assessment-date {
  color: var(--muted);
}

.assessment-score {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.level-badge.baixo {
  background: var(--green-soft);
  color: var(--green);
}

.level-badge.moderado {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.level-badge.alto {
  background: var(--red-soft);
  color: var(--red);
}

.user-no-assessment {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-style: italic;
}

/* ═══ EMPTY & FOOTER ═══ */

.empty {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 18px;
}

.dash-footer {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding-top: 4px;
}

/* ═══ RESPONSIVE ═══ */

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

  .login-brand {
    min-height: auto;
    padding-bottom: 44px;
  }

  .login-brand-content {
    padding: 60px 0 30px;
  }

  .login-visual {
    width: 300px;
    opacity: 0.5;
  }

  .login-panel {
    min-height: auto;
    padding-top: 36px;
    padding-bottom: 48px;
  }
}

@media (max-width: 640px) {
  .login-brand {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .tab-content.active {
    grid-template-columns: 1fr;
  }

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

  .dash-header {
    flex-direction: column;
    gap: 12px;
  }

  .secondary-button {
    width: 100%;
  }

  .gauge-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .section-title {
    flex-direction: column;
    gap: 2px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 22px;
  }
}

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