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

:root {
  --bg-app: #fffff3;
  --bg-soft: #ffffe2;
  --bg-card: #fffef8;
  --bg-sidebar: #1b0d25;
  --brand-primary: #ff5a52;
  --brand-red: #e84545;
  --brand-orange: #ff7e5f;
  --brand-yellow: #ffd48a;
  --brand-green-soft: #9cd9b7;
  --brand-green: #1a8f6a;
  --brand-teal: #44c0a7;
  --brand-blue: #7eb2dd;
  --text-main: #2e3338;
  --text-muted: #586f7c;
  --border-soft: #eadfcb;
  --shadow-soft: 0 8px 24px rgba(34, 20, 46, 0.08);
  --radius-card: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, #fffef2 0%, #fffff8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 84px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  box-shadow: 0 12px 28px rgba(27, 13, 37, 0.22);
}

.topbar__logo {
  display: block;
  width: auto;
  height: 44px;
  object-fit: contain;
}

.main-content {
  padding: 34px 40px 96px;
  background:
    radial-gradient(circle at top right, rgba(255, 212, 138, 0.18), transparent 30%),
    linear-gradient(180deg, #fffef4 0%, #fffff9 100%);
  max-width: 1440px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0;
  font-size: 2.35rem;
  letter-spacing: -0.03em;
}

.page-header p {
  margin: 10px 0 0;
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.6;
}

.badge-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pill,
.status-chip,
.robust-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border-soft);
  background: #fff;
}

.pill--cycle {
  background: #fff8f0;
}

.pill--progress {
  background: #f6fff9;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 240px 200px auto;
  gap: 12px;
  margin-bottom: 28px;
}

.toolbar input,
.toolbar select,
.toolbar label {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  min-height: 52px;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar input[type="checkbox"] {
  min-height: auto;
  padding: 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 146px;
}

.metric-card__label {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.metric-card__value {
  margin-top: 20px;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-card__value--accent {
  color: var(--brand-teal);
}

.metric-card__value--warm {
  color: var(--brand-primary);
}

.table-card {
  overflow: hidden;
}

.chart-card {
  margin-bottom: 28px;
}

.chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chart-card__header h2 {
  margin: 0;
  font-size: 1.34rem;
}

.chart-card__header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.chart {
  display: grid;
  gap: 14px;
}

.chart-row {
  display: grid;
  grid-template-columns: 220px 1fr 72px;
  gap: 14px;
  align-items: center;
}

.chart-row__label {
  font-weight: 600;
}

.chart-track {
  height: 18px;
  border-radius: 999px;
  background: #f4ecdf;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7e5f 0%, #ffd48a 45%, #44c0a7 100%);
}

.chart-value {
  text-align: right;
  font-weight: 700;
}

.mini-bars-card {
  margin-bottom: 2px;
}

.mini-bars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.mini-bar {
  background: #fffdf7;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 18px 16px;
}

.mini-bar__label {
  font-weight: 700;
  margin-bottom: 14px;
}

.mini-bar__track {
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(244,236,223,0.8) 100%);
}

.mini-bar__fill {
  width: 100%;
  max-width: 72px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #44c0a7 0%, #7eb2dd 100%);
  box-shadow: inset 0 -10px 18px rgba(255,255,255,0.15);
}

.mini-bar__value {
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.mini-bar__meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.table-scroll {
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid #f0e8db;
  vertical-align: middle;
}

th {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.status-chip {
  font-weight: 600;
}

.status-chip--nao_iniciado {
  background: #f6f2ed;
}

.status-chip--em_andamento {
  background: #fff2ce;
}

.status-chip--concluido {
  background: #ddf5e9;
  color: #0f6c50;
}

.button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
}

.button--primary {
  background: var(--brand-primary);
  color: white;
}

.button--secondary {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.button--ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px dashed var(--border-soft);
}

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

.team-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.team-title {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-title h1 {
  margin: 0;
  font-size: 2.35rem;
  letter-spacing: -0.03em;
}

.team-title__meta {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-chip {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 18px;
}

.summary-chip strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 10px;
}

.dimension-card {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 28px;
}

.dimension-card__title {
  margin: 0 0 12px;
  font-size: 1.34rem;
}

.dimension-card__question {
  margin: 0;
  line-height: 1.65;
  color: var(--text-main);
  font-size: 1rem;
}

.dimension-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.mini-stat {
  background: #fffdf7;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px;
}

.mini-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mini-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 1.35rem;
}

.scale-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.scale-option {
  border-radius: 18px;
  border: 2px solid transparent;
  min-height: 142px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.scale-option:hover {
  transform: translateY(-2px);
}

.scale-option--selected {
  border-color: var(--bg-sidebar);
  box-shadow: 0 12px 28px rgba(27, 13, 37, 0.18);
}

.scale-option__score {
  font-size: 1.8rem;
  font-weight: 800;
}

.scale-option__label {
  font-weight: 700;
  max-width: 11ch;
  line-height: 1.35;
}

.scale-option--1 { background: rgba(232, 69, 69, 0.18); }
.scale-option--2 { background: rgba(255, 126, 95, 0.2); }
.scale-option--3 { background: rgba(255, 212, 138, 0.35); }
.scale-option--4 { background: rgba(156, 217, 183, 0.32); }
.scale-option--5 { background: rgba(26, 143, 106, 0.22); }

.comments-card {
  max-height: 360px;
  overflow: auto;
}

.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid #efe6d7;
  line-height: 1.55;
}

.comment-item:last-child {
  border-bottom: 0;
}

.textarea-field textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 16px;
  background: #fffdfa;
  resize: vertical;
}

.textarea-field p {
  color: var(--text-muted);
  margin-top: 8px;
}

.footer-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 248, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.footer-bar__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.footer-bar__summary .pill {
  background: #fff;
}

.footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.helper-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.error-text {
  margin-top: 8px;
  color: var(--brand-red);
  font-size: 0.92rem;
}

.notice {
  position: sticky;
  top: 96px;
  z-index: 8;
  margin-bottom: 14px;
  border-radius: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.notice--success {
  border-color: rgba(26, 143, 106, 0.28);
  background: #f1fbf6;
  color: #0f6c50;
}

.notice--error {
  border-color: rgba(232, 69, 69, 0.22);
  background: #fff3f1;
  color: #a23939;
}

.button--loading {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .toolbar,
  .cards-grid,
  .summary-strip,
  .dimension-card,
  .scale-selector {
    grid-template-columns: 1fr;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .mini-bars-grid {
    grid-template-columns: 1fr;
  }

  .team-header,
  .page-header,
  .footer-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    height: auto;
    padding: 18px 20px;
    align-items: center;
    justify-content: flex-start;
  }

  .main-content {
    padding: 24px 18px 96px;
  }
}
