/* === Project Economics Calculator Widget === */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Sora:wght@300;400;500;600&display=swap');

.npvc-wrap {
  --npvc-bg:        #f0f9ff;
  --npvc-card:      #ddf0fc;
  --npvc-card2:     #c8e8f8;
  --npvc-border:    rgba(3,169,244,0.2);
  --npvc-accent:    #00d4aa;
  --npvc-accent2:   #1565c0;
  --npvc-accent3:   #f59e0b;
  --npvc-text:      #0a1a2e;
  --npvc-muted:     #1a3a5c;
  --npvc-danger:    #c62828;
  --npvc-success:   #1b5e20;
  --npvc-radius:    12px;
  --npvc-font:      'Sora', sans-serif;
  --npvc-mono:      'DM Mono', monospace;

  font-family: var(--npvc-font);
  background: var(--npvc-bg);
  color: var(--npvc-text);
  border-radius: 16px;
  padding: 28px;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
}

.npvc-wrap *, .npvc-wrap *::before, .npvc-wrap *::after {
  box-sizing: border-box;
}

/* Header */
.npvc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.npvc-header-icon {
  color: #0a1a2e;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.npvc-header-icon svg { width: 40px; height: 40px; }
.npvc-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 2px;
  color: #0a1a2e;
  letter-spacing: -0.3px;
}
.npvc-subtitle {
  font-size: 12px;
  color: var(--npvc-muted);
  margin: 0;
  font-family: var(--npvc-mono);
  letter-spacing: 0.05em;
}

/* Print button */
.npvc-print-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0a1a2e;
  color: #5DCBFD;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--npvc-font);
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.npvc-print-btn:hover { opacity: 0.82; }
.npvc-print-btn svg { flex-shrink: 0; }

/* Cards */
.npvc-card {
  background: var(--npvc-card);
  border: 1px solid var(--npvc-border);
  border-radius: var(--npvc-radius);
  padding: 14px;
  margin-bottom: 8px;
}

/* Change 3: Section label blocks background #03a9f4 */
.npvc-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: #03a9f4;
  margin: -14px -14px 10px -14px;
  padding: 6px 14px;
  border-radius: var(--npvc-radius) var(--npvc-radius) 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.npvc-badge {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
}

/* Grids */
.npvc-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.npvc-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}
@media (max-width: 700px) {
  .npvc-grid-3 { grid-template-columns: 1fr 1fr; }
  .npvc-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 460px) {
  .npvc-grid-3 { grid-template-columns: 1fr; }
  .npvc-grid-5 { grid-template-columns: 1fr 1fr; }
}

/* Change 9: Full-width project name field */
.npvc-field-fullwidth {
  width: 100%;
  margin-bottom: 0;
}
.npvc-field-fullwidth .npvc-in {
  width: 100%;
}

/* Fields */
.npvc-field { display: flex; flex-direction: column; gap: 3px; }
.npvc-field label {
  font-size: 11px;
  color: var(--npvc-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Change 4: Input background #5DCBFD (slightly lighter than card for contrast) */
/* Change 5: Focus color #f5f5f5 */
.npvc-in {
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #0a1a2e;
  font-family: var(--npvc-mono);
  width: 100%;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -moz-appearance: textfield;
}
.npvc-in::-webkit-outer-spin-button,
.npvc-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.npvc-in:focus {
  outline: none;
  border-color: #0a1a2e;
  background: #f5f5f5;
  color: #0a1a2e;
}
.npvc-hint {
  font-size: 10px;
  color: var(--npvc-muted);
  line-height: 1.4;
}

/* Weight total indicator */
.npvc-weight-total {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--npvc-mono);
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0;
}
.npvc-weight-total.ok strong { color: #b9f6ca; }
.npvc-weight-total.bad strong { color: #ffcdd2; }

/* Calculate button */
.npvc-btn {
  width: 100%;
  background: #0a1a2e;
  color: #5DCBFD;
  border: none;
  border-radius: var(--npvc-radius);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--npvc-font);
  cursor: pointer;
  margin: 4px 0 12px;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
}
.npvc-btn:hover { opacity: 0.85; }
.npvc-btn:active { transform: scale(0.99); }
.npvc-btn.loading { opacity: 0.6; cursor: wait; }

/* Results metrics */
.npvc-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .npvc-results-grid { grid-template-columns: 1fr 1fr; }
}
.npvc-metric-card {
  background: var(--npvc-card);
  border: 1px solid var(--npvc-border);
  border-radius: var(--npvc-radius);
  padding: 10px 10px;
  text-align: center;
}
.npvc-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--npvc-muted);
  margin-bottom: 4px;
}
.npvc-metric-value {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--npvc-mono);
  color: var(--npvc-text);
}
.npvc-metric-value.positive { color: #1b5e20; }
.npvc-metric-value.negative { color: #b71c1c; }

/* Monte Carlo card */
.npvc-mc-card { margin-bottom: 8px; }
.npvc-mc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 600px) { .npvc-mc-grid { grid-template-columns: 1fr; } }

.npvc-mc-item {
  background: rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 10px;
  border-left: 3px solid transparent;
}
.npvc-p50 { border-left-color: #00897b; }
.npvc-p80 { border-left-color: #1565c0; }
.npvc-p90 { border-left-color: #e65100; }

.npvc-mc-pct {
  font-size: 11px;
  font-family: var(--npvc-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
.npvc-p50 .npvc-mc-pct { color: #00695c; }
.npvc-p80 .npvc-mc-pct { color: #0d47a1; }
.npvc-p90 .npvc-mc-pct { color: #bf360c; }

.npvc-mc-val {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--npvc-mono);
  color: var(--npvc-text);
  margin-bottom: 3px;
}
.npvc-mc-desc {
  font-size: 11px;
  color: var(--npvc-muted);
  line-height: 1.4;
}

/* MC stats row */
.npvc-mc-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--npvc-border);
}
.npvc-mc-stat { display: flex; flex-direction: column; gap: 3px; }
.npvc-mc-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--npvc-muted);
}
.npvc-mc-stat-val {
  font-size: 15px;
  font-weight: 500;
  font-family: var(--npvc-mono);
  color: var(--npvc-text);
}

/* Verdict */
.npvc-verdict-wrap {
  background: var(--npvc-card);
  border: 1px solid var(--npvc-border);
  border-radius: var(--npvc-radius);
  padding: 0;
  overflow: hidden;
}
.npvc-verdict-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: #03a9f4;
  padding: 6px 14px;
}
.npvc-verdict-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--npvc-text);
  font-weight: 400;
  padding: 10px 14px;
}
.npvc-verdict-text.exceptional { border-left: 4px solid #1b5e20; }
.npvc-verdict-text.excellent   { border-left: 4px solid #00695c; }
.npvc-verdict-text.good        { border-left: 4px solid #0d47a1; }
.npvc-verdict-text.acceptable  { border-left: 4px solid #e65100; }
.npvc-verdict-text.marginal    { border-left: 4px solid #bf360c; }
.npvc-verdict-text.poor        { border-left: 4px solid #b71c1c; }

/* Print styles */
/* Spinner */
.npvc-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(10,26,46,0.2);
  border-top-color: #0a1a2e;
  border-radius: 50%;
  animation: npvc-spin 0.7s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes npvc-spin { to { transform: rotate(360deg); } }

.npvc-wrap *, .npvc-wrap *::before, .npvc-wrap *::after {
  box-sizing: border-box;
}




/* ── wpDataTables trigger button ─────────────────────────── */
.npvc-wdt-open-btn {
  display: inline-flex;
  align-items: center;
  background: #03a9f4;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.npvc-wdt-open-btn:hover { opacity: 0.82; }

/* ── Full-screen modal overlay ───────────────────────────── */
.npvc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.npvc-modal-shell {
  background: #f0f9ff;
  border-radius: 16px;
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 60px rgba(0,0,0,0.35);
  position: relative;
  margin-top: 65px;
}

/* Cost-Benefits button in titlebar — centred, height matches Print */
.npvc-cb-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #158741;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--npvc-font);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.npvc-cb-btn:hover { background: #0f6b32; }

/* ── Modal title bar ─────────────────────────────────────── */
.npvc-modal-titlebar {
  background: #03a9f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 12px;
  flex-shrink: 0;
}
.npvc-modal-titlebar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;          /* takes up left third */
  min-width: 0;
}
/* Centred Cost-Benefits slot */
.npvc-modal-titlebar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.npvc-modal-titlebar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  justify-content: flex-end;
  flex: 1;          /* mirrors left so centre stays truly centred */
}
.npvc-header-icon {
  color: #fff;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.npvc-header-icon svg { width: 36px; height: 36px; }

.npvc-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 2px;
  font-family: var(--npvc-font);
}
.npvc-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  margin: 0;
  font-family: var(--npvc-mono);
  letter-spacing: 0.04em;
}

.npvc-linkage-badge {
  font-size: 11px;
  font-family: var(--npvc-mono);
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

.npvc-modal-x {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.8;
}
.npvc-modal-x:hover { opacity: 1; }

/* ── Status bar ──────────────────────────────────────────── */
.npvc-status-bar {
  background: rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding: 6px 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.npvc-status-msg {
  font-size: 12px;
  font-family: var(--npvc-mono);
  color: #0a1a2e;
  flex-shrink: 1;
  min-width: 0;
}
.npvc-status-msg.ok    { color: #1b5e20; }
.npvc-status-msg.error { color: #b71c1c; }
.npvc-status-msg.info  { color: #0d47a1; }
.npvc-status-msg.saving { color: #e65100; }
.npvc-status-hint {
  font-size: 11px;
  font-family: var(--npvc-mono);
  color: #1a3a5c;
  font-style: italic;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ── Scrollable body ─────────────────────────────────────── */
.npvc-modal-body-scroll {
  overflow-y: auto;
  padding: 12px 14px 6px;
  flex: 1;
}

/* ── Modal footer ────────────────────────────────────────── */
.npvc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  gap: 10px;
}
.npvc-footer-right {
  display: flex;
  gap: 8px;
}

.npvc-footer-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--npvc-font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.npvc-footer-btn:active { transform: scale(0.98); }

.npvc-footer-submit {
  background: #0a1a2e;
  color: #5DCBFD;
}
.npvc-footer-submit:hover { opacity: 0.85; }

.npvc-footer-close {
  background: rgba(255,255,255,0.4);
  color: #0a1a2e;
}
.npvc-footer-close:hover { background: rgba(255,255,255,0.6); }

.npvc-footer-delete {
  background: #b71c1c;
  color: #fff;
}
.npvc-footer-delete:hover { opacity: 0.85; }

/* ── Inner widget content (inherits from main CSS) ────────── */
.npvc-modal-shell .npvc-wrap {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* ── Print ───────────────────────────────────────────────── */
/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .npvc-modal-overlay { padding: 0; align-items: flex-start; }
  .npvc-modal-shell   { border-radius: 0; min-height: 100vh; }
}
