/* ── Sidebar ───────────────────────────────────────────── */

.ws-profile {
  text-align: center;
  padding: 28px 16px 20px;
  border-bottom: 1px solid var(--line);
}

.ws-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 17px;
  font-weight: 600;
}

.ws-profile strong {
  display: block;
  font-size: 14px;
}

.ws-profile small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 2px;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.nav-item.is-active {
  color: var(--blue);
  background: var(--blue-soft);
  border-left-color: var(--blue);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .ws-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 0;
    text-align: left;
  }

  .ws-avatar {
    width: 38px;
    height: 38px;
    margin: 0;
    font-size: 13px;
  }

  .nav {
    display: flex;
    padding: 0 8px;
  }

  .nav-item {
    border-left: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }

  .nav-item.is-active {
    border-bottom-color: var(--blue);
  }

  .sidebar-foot {
    display: none;
  }
}

/* ── Botões ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.btn:hover {
  border-color: var(--blue);
  color: var(--blue-strong);
}

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

.btn-primary:hover {
  background: var(--blue-strong);
  border-color: var(--blue-strong);
  color: #fff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--risk-high);
}

/* ── Page header ───────────────────────────────────────── */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-head .title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.page-head p {
  margin-top: 4px;
  color: var(--muted);
  max-width: 640px;
}

/* ── Cards / paineis ───────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 22px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
  align-items: start;
}

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

/* ── Formularios ───────────────────────────────────────── */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px 12px;
  font-weight: 400;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.15);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.upload-box {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg);
  font-size: 12.5px;
  color: var(--muted);
}

.upload-box input {
  width: 100%;
  margin-top: 6px;
}

.upload-box img,
.upload-box video {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

/* ── Segmented (sim/parcial/nao/nao sei + filtros) ─────── */

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  background: var(--blue);
  color: #fff;
}

/* ── Checklist ─────────────────────────────────────────── */

.q-group {
  margin-bottom: 18px;
}

.q-group-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-strong);
}

.question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.question.is-missing {
  border-color: var(--risk-high);
  background: #FFF8F7;
}

.question .q-label {
  font-weight: 600;
  font-size: 13px;
}

.question .q-source {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
}

.question .segmented {
  margin-top: 10px;
  width: 100%;
}

.question .segmented button {
  flex: 1;
}

/* ── Tabela de historico ───────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.table tbody tr {
  cursor: pointer;
}

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

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .cell-label {
  font-weight: 600;
}

.table .cell-muted {
  color: var(--muted);
}

/* ── Dots de risco ─────────────────────────────────────── */

.dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dot-baixo { color: var(--risk-low); }
.dot-medio { color: var(--risk-mid); }
.dot-alto { color: var(--risk-high); }
.dot-critico { color: var(--risk-critical); }
.dot-incompleto { color: var(--risk-incomplete); }

/* ── Resultado / parecer ───────────────────────────────── */

.result-placeholder {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.score-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.score-box {
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}

.score-box .num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.score-box .lvl {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.score-baixo { background: var(--risk-low-bg); color: var(--risk-low); }
.score-medio { background: var(--risk-mid-bg); color: var(--risk-mid); }
.score-alto { background: var(--risk-high-bg); color: var(--risk-high); }
.score-critico { background: var(--risk-critical-bg); color: var(--risk-critical); }
.score-incompleto { background: var(--risk-incomplete-bg); color: var(--risk-incomplete); }

.score-action {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.score-action strong {
  display: block;
  font-size: 13.5px;
}

.score-action p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.finding {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
}

.finding-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.finding-head strong {
  font-size: 13px;
}

.finding-head .src {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-strong);
  white-space: nowrap;
}

.finding p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.rewrite {
  margin-top: 14px;
  border-radius: 8px;
  background: var(--risk-low-bg);
  padding: 12px 14px;
}

.rewrite strong {
  display: block;
  font-size: 12.5px;
  color: #085041;
}

.rewrite p {
  margin-top: 4px;
  font-size: 12.5px;
  color: #0F6E56;
}

/* ── Normas ────────────────────────────────────────────── */

.source-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.source-row:first-child {
  border-top: 0;
}

.source-row strong {
  font-size: 13px;
}

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

@media (max-width: 700px) {
  .source-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── Tela de acesso ────────────────────────────────────── */

.access-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.access-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 36px 32px;
}

.access-card .ws-avatar {
  margin-bottom: 14px;
}

.access-card p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Relatorio (tela) ──────────────────────────────────── */

.report {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 48px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}

.report-head .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-strong);
}

.report h1 {
  font-size: 24px;
  margin-top: 4px;
}

.report-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.report-section {
  margin-bottom: 22px;
}

.report-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-strong);
  margin-bottom: 10px;
}

.report-input {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  white-space: pre-wrap;
}

.report-disclaimer {
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.report-actions {
  max-width: 820px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ── Util ──────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}

.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.error-banner {
  background: var(--risk-high-bg);
  color: var(--risk-high);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
