/* NSF Pension Calculator - scoped styles */
.nsfpc-root{
  --primary:#0056b3;
  --secondary:#00a86b;
  --warning:#ff9800;
  --danger:#f44336;
  --bg:#f4f7f6;
  --text:#222;
  --muted:#666;
  --card:#ffffff;

  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,.06);
}

.nsfpc-header{ text-align:center; margin-bottom: 12px; }
.nsfpc-title{ margin: 0 0 6px; color: var(--primary); font-size: 1.35rem; }
.nsfpc-subtitle{ margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.35; }

.nsfpc-alerts{ margin: 12px 0; }
.nsfpc-alert{
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: .9rem;
  line-height: 1.5;
  background: #eef5ff;
  border-right: 4px solid #2b7de9;
  color: #0f3d7a;
}
.nsfpc-alert--warning{
  background: #fff6e6;
  border-right-color: var(--warning);
  color: #7a4a00;
}
.nsfpc-alert--danger{
  background: #ffecec;
  border-right-color: var(--danger);
  color: #7a0f0f;
}

.nsfpc-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.nsfpc-card{
  background: #f8f9fa;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.nsfpc-card-inner{
  margin-bottom: 10px;
}

.nsfpc-card-title{
  font-weight: 800;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-size: 1rem;
}

.nsfpc-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nsfpc-field{ margin-bottom: 10px; }
.nsfpc-field label{
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: .9rem;
  color: #444;
}

.nsfpc-root input,
.nsfpc-root select{
  width: 100%;
  padding: 10px 10px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  transition: border-color .2s;
}

.nsfpc-root input:focus,
.nsfpc-root select:focus{
  border-color: var(--primary);
  outline: none;
}

.nsfpc-hint{
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.nsfpc-check{
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  margin-top: 8px;
}
.nsfpc-check input{ width: auto; }

.nsfpc-advanced{
  background: #f8f9fa;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px dashed #d7d7d7;
}
.nsfpc-advanced summary{
  cursor: pointer;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.nsfpc-tabs{
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #ddd;
  margin-bottom: 12px;
}
.nsfpc-tab{
  padding: 10px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 800;
  color: #666;
  border-bottom: 3px solid transparent;
}
.nsfpc-tab.is-active{
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nsfpc-tabpanel{ display: none; }
.nsfpc-tabpanel.is-active{ display: block; }

.nsfpc-kpis{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.nsfpc-kpi{
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #003d82);
  box-shadow: 0 4px 6px rgba(0,0,0,.08);
  text-align: center;
}
.nsfpc-kpi--secondary{
  background: linear-gradient(135deg, var(--secondary), #008055);
}
.nsfpc-kpi--warning{
  background: linear-gradient(135deg, var(--warning), #e68900);
}
.nsfpc-kpi--info{
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.nsfpc-kpi-label{ font-size: .85rem; opacity: .95; }
.nsfpc-kpi-value{ font-size: 1.55rem; font-weight: 900; margin-top: 6px; direction: ltr; }
.nsfpc-kpi-sub{ font-size: .78rem; opacity: .85; margin-top: 6px; }

.nsfpc-highlight{
  background: #fff9e6;
  border-right: 4px solid #ffc107;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.5;
  color: #3a2a00;
}
.nsfpc-highlight strong{ color: #7a4a00; }

.nsfpc-footnote{
  margin-top: 12px;
  color: #555;
  font-size: .82rem;
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.nsfpc-chart{
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  margin-bottom: 12px;
}
.nsfpc-chart canvas{
  width: 100% !important;
  max-height: 420px;
}

.nsfpc-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.nsfpc-btn{
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}
.nsfpc-btn--primary{ background: var(--primary); color:#fff; }
.nsfpc-btn--secondary{ background: #6c757d; color:#fff; }
.nsfpc-btn--ghost{ background: #eef2f7; color:#223; }

.nsfpc-table-wrap{ overflow-x: auto; }
.nsfpc-table{
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.nsfpc-table th, .nsfpc-table td{
  padding: 10px;
  border: 1px solid #e5e5e5;
  text-align: center;
  white-space: nowrap;
}
.nsfpc-table th{
  background: var(--primary);
  color:#fff;
  font-weight: 900;
}
.nsfpc-table tr:nth-child(even){ background: #fafafa; }

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

@media print{
  .nsfpc-root{ box-shadow: none; }
  .nsfpc-actions, .nsfpc-tabs{ display: none !important; }
  .nsfpc-grid{ grid-template-columns: 1fr; }
  .nsfpc-card, .nsfpc-advanced{ display: none !important; }
  .nsfpc-tabpanel{ display:block !important; }
  .nsfpc-chart{ break-inside: avoid; }
  .nsfpc-footnote{ break-inside: avoid; }
}
