@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Orbitron:wght@400;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ─── ECP Light Theme Tokens ─────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-teal: #21cfb2;
  --brand-teal-80: rgba(33,207,178,0.80);
  --brand-teal-20: rgba(33,207,178,0.20);
  --brand-teal-10: rgba(33,207,178,0.10);
  --brand-teal-08: rgba(33,207,178,0.08);
  --brand-teal-04: rgba(33,207,178,0.04);
  --brand-deep: #002e33;
  --brand-accent-hover: #1ab599;

  /* Surfaces */
  --surface-page: #f4faf9;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --surface-highlight: #e6f9f6;
  --surface-inset: #f0f4f3;

  /* Text */
  --text-primary: #002e33;
  --text-secondary: #30455c;
  --text-muted: #788f9c;
  --text-inverse: #ffffff;

  /* Borders */
  --border-default: #c8dedd;
  --border-subtle: rgba(33,207,178,0.12);
  --border-strong: rgba(0,46,51,0.20);
  --border-focus: var(--brand-teal);

  /* Status */
  --status-success: #21cfb2;
  --status-success-bg: rgba(33,207,178,0.08);
  --status-success-border: rgba(33,207,178,0.20);
  --status-warning: #fc8c66;
  --status-warning-bg: rgba(252,140,102,0.08);
  --status-warning-border: rgba(252,140,102,0.20);
  --status-error: #fc5245;
  --status-error-bg: rgba(252,82,69,0.08);
  --status-error-border: rgba(252,82,69,0.20);
  --status-info: #3b8cff;
  --status-info-bg: rgba(59,140,255,0.08);
  --status-info-border: rgba(59,140,255,0.20);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,46,51,0.04);
  --shadow-sm: 0 1px 3px rgba(0,46,51,0.06), 0 1px 2px rgba(0,46,51,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,46,51,0.07), 0 2px 4px -2px rgba(0,46,51,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,46,51,0.08), 0 4px 6px -4px rgba(0,46,51,0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 200ms cubic-bezier(0.4,0,0.2,1);
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-teal-80); }

/* ─── Typography helpers ─────────────────────────────────────────────── */
.font-label { font-family: 'Orbitron', sans-serif; }
.font-mono  { font-family: 'Space Mono', monospace; }

/* ─── App shell layout ───────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: var(--surface-card);
  border-right: 1px solid var(--border-default);
  z-index: 10;
}

.sidebar-wordmark {
  display: flex;
  align-items: center;
  padding: 24px 14px 16px;
  flex-shrink: 0;
}

.sidebar-app-name {
  padding: 0 14px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-divider {
  margin: 0 10px;
  height: 1px;
  background: var(--border-default);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-section-heading {
  padding: 12px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: var(--surface-highlight);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--brand-teal-08);
  color: var(--brand-teal);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  width: 3px;
  border-radius: 99px;
  background: var(--brand-teal);
}

.nav-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.sidebar-bottom {
  padding: 8px;
  flex-shrink: 0;
}

.sidebar-version {
  padding: 4px 10px 2px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-logout:hover {
  background: var(--status-error-bg);
  color: var(--status-error);
}

/* ─── Main content ───────────────────────────────────────────────────── */
.main-content {
  padding: 32px 40px;
  max-width: 1280px;
}

/* ─── Page header card ───────────────────────────────────────────────── */
.header-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.header-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 280px; height: 180px;
  background: radial-gradient(ellipse at top right, rgba(33,207,178,0.08), transparent 70%);
  pointer-events: none;
}

/* ─── Panel / card ───────────────────────────────────────────────────── */
.panel {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-inset);
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-teal);
  color: var(--text-inverse);
  border-color: var(--brand-teal);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-accent-hover); border-color: var(--brand-accent-hover); }

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-inset); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-highlight); color: var(--text-primary); }

/* ─── Badge / pill ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success  { background: var(--status-success-bg);  color: var(--status-success);  border: 1px solid var(--status-success-border); }
.badge-warning  { background: var(--status-warning-bg);  color: var(--status-warning);  border: 1px solid var(--status-warning-border); }
.badge-error    { background: var(--status-error-bg);    color: var(--status-error);    border: 1px solid var(--status-error-border); }
.badge-info     { background: var(--status-info-bg);     color: var(--status-info);     border: 1px solid var(--status-info-border); }

/* ─── Form inputs ────────────────────────────────────────────────────── */
input, select, textarea {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 7px 11px;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(33,207,178,0.10);
}

/* ─── Stat label ─────────────────────────────────────────────────────── */
.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

/* ─── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Blazor loading progress ────────────────────────────────────────── */
#app .loading-progress circle { stroke: var(--brand-teal); }
#app .loading-progress circle:first-child { stroke: var(--brand-teal-20); }
.loading-progress-text:after { color: var(--text-muted); }

/* ─── Blazor error UI ────────────────────────────────────────────────── */
#blazor-error-ui {
  background: var(--surface-card);
  color: var(--status-error);
  border-top: 1px solid var(--status-error-border);
  bottom: 0; left: 0;
  display: none;
  padding: 0.6rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: var(--status-error-bg); border: 1px solid var(--status-error-border); padding: 1rem; color: var(--status-error); border-radius: var(--radius-md); }
.blazor-error-boundary::after { content: "An error has occurred." }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,46,51,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 460px;
  width: 90%;
}

/* ─── Productivity page ──────────────────────────────────────────────── */

.prod-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.prod-framework-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-teal);
  margin-right: 10px;
}

.prod-framework-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* 4-column grid used for DORA and DX Core 4 */
.prod-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1100px) {
  .prod-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* SPACE 3-column grid */
.prod-space-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1000px) {
  .prod-space-grid { grid-template-columns: 1fr; }
}

/* ── DORA metric card ──────────────────────────────────────────────────── */

.prod-metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow var(--transition-fast);
}

.prod-metric-card:hover {
  box-shadow: var(--shadow-md);
}

.prod-metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prod-metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.prod-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 4px 0 2px;
}

.prod-metric-delta {
  font-size: 11px;
  font-weight: 500;
}

.prod-delta-good    { color: var(--status-success); }
.prod-delta-bad     { color: var(--status-error); }
.prod-delta-neutral { color: var(--text-muted); }

.prod-sparkline-wrap {
  margin-top: 8px;
  opacity: 0.85;
}

/* ── DORA performance level badges ────────────────────────────────────── */

.prod-dora-level {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.prod-dora-elite  { background: rgba(33,207,178,0.12); color: var(--status-success); border: 1px solid rgba(33,207,178,0.25); }
.prod-dora-high   { background: rgba(59,140,255,0.10); color: var(--status-info);    border: 1px solid rgba(59,140,255,0.20); }
.prod-dora-medium { background: rgba(252,140,102,0.10); color: var(--status-warning); border: 1px solid rgba(252,140,102,0.22); }
.prod-dora-low    { background: rgba(252,82,69,0.08);   color: var(--status-error);   border: 1px solid rgba(252,82,69,0.20); }

/* ── SPACE metric rows ─────────────────────────────────────────────────── */

.prod-group-header {
  padding: 12px 18px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-inset);
}

.prod-group-body {
  padding: 4px 0;
}

.prod-space-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.prod-space-row:last-child { border-bottom: none; }

.prod-space-row:hover { background: var(--surface-inset); }

.prod-space-row-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.prod-space-note {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
}

.prod-space-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.prod-space-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ── DX Core 4 cards ───────────────────────────────────────────────────── */

.prod-dx-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prod-dx-pillar {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.prod-dx-score-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.prod-dx-score {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.prod-dx-denom {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.prod-dx-bar-track {
  height: 4px;
  background: var(--surface-inset);
  border-radius: 99px;
  overflow: hidden;
}

.prod-dx-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.prod-dx-insight {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
