/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #F0F2F8;
  color: #1A1D23;
  min-height: 100vh;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 220px;
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.logo-icon {
  font-size: 20px;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: #1A1D23;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 8px 4px;
}

.nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: #F0F2F8;
  color: #1A1D23;
}

.nav-item.active {
  background: #EEF2FF;
  color: #4F46E5;
}

/* ---------- Main Content ---------- */
.main {
  margin-left: 220px;
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.topbar-breadcrumb {
  font-size: 12px;
  color: #9CA3AF;
  margin-bottom: 4px;
}

.topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: #1A1D23;
}

/* ---------- Form Card ---------- */
.form-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1D23;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}

.unit {
  font-weight: 400;
  color: #9CA3AF;
}

.form-group input {
  padding: 10px 14px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1A1D23;
  background: #F9FAFB;
  transition: border 0.15s ease;
  outline: none;
}

.form-group input:focus {
  border-color: #A8C5DA;
  background: #FFFFFF;
}

.btn-analyze {
  background: #1A1D23;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-analyze:hover {
  background: #374151;
}

/* ---------- Tier Banner ---------- */
.tier-banner {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 6px solid #A8C5DA;
  transition: border-left-color 0.3s ease;
}

.tier-label {
  font-size: 12px;
  font-weight: 500;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.tier-value {
  font-size: 36px;
  font-weight: 700;
  color: #1A1D23;
}

.tier-sprint {
  font-size: 13px;
  color: #6B7280;
  margin-top: 4px;
}

.tier-icon {
  font-size: 48px;
}

/* ---------- Metric Cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-name {
  font-size: 12px;
  font-weight: 500;
  color: #9CA3AF;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #1A1D23;
  margin: 4px 0;
}

.metric-unit {
  font-size: 11px;
  color: #9CA3AF;
  margin-bottom: 8px;
}

/* ---------- Tier Pills ---------- */
.tier-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}

.tier-elite {
  background: #DCFCE7;
  color: #16A34A;
}

.tier-high {
  background: #DBEAFE;
  color: #1D4ED8;
}

.tier-medium {
  background: #FEF3C7;
  color: #B45309;
}

.tier-low {
  background: #FEE2E2;
  color: #DC2626;
}

/* ---------- Chart Card ---------- */
.chart-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ---------- AI Insights ---------- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.insight-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1A1D23;
}

.insight-card p {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.6;
}

.insight-card ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-card ul li {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
}

.retro-card {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
}

.retro-question {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #4F46E5 !important;
  font-style: italic;
}

/* ---------- Loading ---------- */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
  color: #6B7280;
  font-size: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E5E7EB;
  border-top-color: #A8C5DA;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 600px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 16px;
  }

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