/* ============================================================
   DecisionSphere — Main Stylesheet
   Accent: #d97706 (amber)
   ============================================================ */

:root {
  /* Brand */
  --accent:      #1d4ed8;
  --accent-dark: #1e3a8a;
  --focus-ring:  rgba(29, 78, 216, .20);

  /* Palette */
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --text:        #111827;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;

  /* Feedback */
  --error:       #dc2626;
  --error-bg:    #fee2e2;
  --success:     #16a34a;
  --success-bg:  #dcfce7;

  /* Tokens */
  --radius:      0.5rem;
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&display=swap');

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

body {
  font-family: 'Public Sans', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ----- Typography ----- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { margin: 0; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  padding: 0.65rem 1.25rem;
  background-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background-color: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background-color: var(--accent);
  color: #fff;
}

/* ----- Alerts ----- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error   { background-color: var(--error-bg);   color: var(--error); }
.alert-success { background-color: var(--success-bg); color: var(--success); }

/* ----- Forms ----- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}
.form-group.compact { margin-bottom: 0.875rem; }
.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
}
.form-group input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  background-color: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ----- Auth Layout ----- */
.page-login {
  display: flex;
  justify-content: center;
  align-items: center;
}
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}
.auth-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-header h1 {
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ----- Navbar ----- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-back-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.navbar-back-link:hover {
  color: var(--accent);
  background: var(--focus-ring);
}

.navbar-brand-sep {
  color: var(--border);
  font-weight: 300;
}

.navbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* ----- Container ----- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ----- Page Header ----- */
.page-header { margin-bottom: 1.75rem; }

/* ----- Stats Grid ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border-left: 4px solid var(--accent);
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

/* ----- Content Sections ----- */
.content-section {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.content-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ----- Activity List ----- */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-text { flex: 1; }
.activity-date {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  .auth-card { padding: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0.625rem 1rem; }
  .container { padding: 1.25rem 1rem; }
}

/* ----- Landing Page ----- */
.page-landing {
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.14), transparent 48%),
    radial-gradient(circle at 80% 8%, rgba(30, 64, 175, 0.12), transparent 42%),
    linear-gradient(180deg, #f4f8ff 0%, #ffffff 60%, #f1f5ff 100%);
  padding: 1.75rem;
}

.language-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.75rem;
}

.lang-flag-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #c7d7ff;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.lang-flag-btn:hover {
  transform: translateY(-1px);
  border-color: #2563eb;
}

.lang-flag-btn.is-active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .16);
}

.navbar .language-flags {
  margin-bottom: 0;
  padding: 0.25rem 0.35rem;
  box-shadow: none;
}

.navbar .lang-flag-btn {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.landing-header {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto 1.75rem;
}

.brand-panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #dbe7ff;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.brand-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.brand-title {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #0f2f74;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  margin-bottom: 0.35rem;
}

.brand-subtitle {
  max-width: 62ch;
  color: #334155;
  margin-bottom: 1.25rem;
}

.access-box {
  background: #fff;
  border: 1px solid #dbe7ff;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  align-self: start;
}

.access-box h2 {
  font-size: 1.1rem;
  color: #111827;
  margin-bottom: 0.2rem;
}

.access-box .text-muted {
  margin-bottom: 0.85rem;
}

.landing-main {
  max-width: 1180px;
  margin: 0 auto;
}

.hero-copy {
  background: #fff;
  border: 1px solid #e0e9ff;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.8rem;
  margin-bottom: 1.25rem;
}

.hero-copy h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: #0f2f74;
  margin-bottom: 0.5rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.hero-copy p {
  color: #334155;
  max-width: 75ch;
  margin-bottom: 1rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.value-card {
  background: #fff;
  border-radius: 0.9rem;
  border: 1px solid #e0e9ff;
  box-shadow: var(--shadow);
  padding: 1.15rem;
}

.value-card h3 {
  color: #1e3a8a;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.value-card p {
  color: #475569;
  font-size: 0.95rem;
}

.target-section {
  background: #fff;
  border-radius: 0.9rem;
  border: 1px solid #e0e9ff;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.target-section h3 {
  color: #1e3a8a;
  margin-bottom: 0.65rem;
}

.market-list {
  padding-left: 1.05rem;
  color: #334155;
}

.market-list li + li {
  margin-top: 0.35rem;
}

/* ----- Binder Workspace ----- */
.page-binder {
  background: linear-gradient(180deg, #edf2ff 0%, #f9fbff 100%);
}

.binder-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem;
}

.binder-header {
  margin-bottom: 1rem;
}

.venture-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid #dbe7ff;
  border-radius: 0.8rem;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.venture-tab {
  border: 1px solid #c9d8ff;
  background: #f8fbff;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e3a8a;
}

.venture-tab.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.binder-body {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.startup-sidebar,
.stage-sidebar,
.startup-content,
.admin-panel {
  background: #ffffff;
  border: 1px solid #dbe7ff;
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.startup-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.stage-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.startup-tab {
  text-align: left;
  border: 1px solid #d5e0ff;
  background: #f8fbff;
  color: #1f2937;
  border-radius: 0.6rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.startup-tab.is-active {
  border-color: #1d4ed8;
  background: #edf3ff;
  color: #0f2f74;
  font-weight: 600;
}

.stage-tab {
  text-align: left;
  border: 1px solid #d5e0ff;
  background: #f8fbff;
  color: #1f2937;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.stage-tab.is-active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
}

.stage-tab-title {
  display: block;
  font-size: 0.92rem;
}

.stage-tab-count {
  display: block;
  font-size: 0.78rem;
  opacity: 0.8;
}

.form-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0 1rem;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe7ff;
  background: #f8fbff;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.stage-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.stage-form-actions .btn {
  width: auto;
}

.question-card {
  border: 1px solid #dbe7ff;
  border-radius: 0.85rem;
  background: #fbfcff;
  padding: 0.95rem;
}

.question-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
}

.question-card-title {
  font-size: 1rem;
  color: #111827;
}

.question-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.question-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.question-tag.type {
  background: #e0e9ff;
  color: #1e3a8a;
}

.question-tag.required {
  background: #fee2e2;
  color: #b91c1c;
}

.question-explanation {
  color: #475569;
  margin-bottom: 0.55rem;
}

.answer-label {
  display: block;
  margin: 0.45rem 0 0.3rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ai-comment-label {
  margin-top: 0.65rem;
}

.ai-comment-field {
  width: 100%;
  border: 1px solid #dbe7ff;
  border-radius: 0.55rem;
  padding: 0.6rem;
  font-size: 0.9rem;
  color: #334155;
  background: #f8fbff;
  white-space: pre-wrap;
}

.answer-input,
.answer-textarea,
.answer-select {
  width: 100%;
  border: 1px solid #cfd9f6;
  border-radius: 0.55rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
  color: #111827;
  background: #ffffff;
}

.answer-textarea {
  min-height: 84px;
  resize: vertical;
}

.answer-input:disabled,
.answer-textarea:disabled,
.answer-select:disabled {
  background: #f1f5f9;
  color: #475569;
}

.answer-radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.answer-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #1f2937;
}

.question-placeholder {
  color: #64748b;
  font-size: 0.88rem;
  margin-bottom: 0.55rem;
}

.question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.question-option {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe7ff;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.8rem;
}

.startup-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.kpi-demo-wrap {
  margin-top: 1rem;
  border: 1px solid #dbe7ff;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 0.9rem;
}

.kpi-demo-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.kpi-demo-header h4 {
  color: #1e3a8a;
}

.tower-panel {
  border: 1px solid #d5e0ff;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f1f5ff 0%, #ffffff 100%);
  padding: 0.8rem;
  margin-bottom: 0.85rem;
}

.tower-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.tower-header h5 {
  font-size: 0.95rem;
  color: #1e3a8a;
}

.tower-alert-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.74rem;
  font-weight: 700;
}

.tower-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0.75rem;
}

.tower-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.tower-card {
  border: 1px solid #c9d8ff;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.55rem;
}

.tower-card h6 {
  font-size: 0.83rem;
  color: #0f2f74;
  margin-bottom: 0.45rem;
}
.tower-cards.single-startup {
  grid-template-columns: 1fr;
}

.tower-gauge {
  height: 0.48rem;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.kpi-startup-grid.single-startup {
  grid-template-columns: 1fr;
}

.tower-gauge-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.tower-gauge-fill.is-green,
.kpi-health-bar-fill.is-green,
.trend-bar.is-green {
  background: #16a34a;
}

.tower-gauge-fill.is-amber,
.kpi-health-bar-fill.is-amber,
.trend-bar.is-amber {
  background: #d97706;
}

.tower-gauge-fill.is-red,
.kpi-health-bar-fill.is-red,
.trend-bar.is-red {
  background: #dc2626;
}

.tower-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  color: #475569;
}

.tower-score-row strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.tower-trend,
.kpi-trend-strip {
  height: 2.3rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 0.2rem;
}

.trend-bar {
  display: block;
  width: 100%;
  border-radius: 0.3rem 0.3rem 0 0;
  opacity: 0.92;
}

.tower-table-wrap {
  overflow-x: auto;
}

.tower-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.77rem;
  background: #ffffff;
  border-radius: 0.6rem;
  overflow: hidden;
}

.tower-table th,
.tower-table td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.42rem 0.34rem;
}

.tower-table th {
  color: #1e3a8a;
  font-weight: 700;
  background: #eef2ff;
}

.kpi-startup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  width: 100%;
}

.kpi-startup-card {
  border: 1px solid #d5e0ff;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.8rem;
  width: 100%;
}

.kpi-startup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.kpi-startup-header h5 {
  font-size: 0.96rem;
  color: #0f2f74;
}

.kpi-health-bar-wrap {
  height: 0.52rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.kpi-health-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.kpi-trend-strip {
  margin-bottom: 0.55rem;
}

.kpi-mini-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.kpi-mini-item {
  border: 1px solid #dbe7ff;
  border-radius: 0.55rem;
  background: #f8fbff;
  padding: 0.45rem 0.5rem;
}

.kpi-mini-item span {
  display: block;
  font-size: 0.73rem;
  color: #64748b;
}

.kpi-mini-item strong {
  font-size: 0.88rem;
  color: #0f172a;
}

.kpi-table-wrap {
  overflow-x: auto;
}

.kpi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}

.kpi-table th,
.kpi-table td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 0.44rem 0.3rem;
  vertical-align: top;
}

.kpi-table th {
  color: #1e3a8a;
  font-weight: 700;
  background: #f1f5ff;
}

.kpi-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.kpi-status-chip.is-green {
  background: #dcfce7;
  color: #166534;
}

.kpi-status-chip.is-amber {
  background: #fef3c7;
  color: #92400e;
}

.kpi-status-chip.is-red {
  background: #fee2e2;
  color: #b91c1c;
}

.mini-card {
  border: 1px solid #dbe7ff;
  border-radius: 0.75rem;
  padding: 0.8rem;
  background: #f8fbff;
}

.mini-card h4 {
  font-size: 0.92rem;
  color: #1e3a8a;
  margin-bottom: 0.3rem;
}

.mini-card p {
  color: #334155;
  font-size: 0.9rem;
}

.admin-panel {
  margin-bottom: 1rem;
}

.admin-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 1rem;
  z-index: 30;
}

.admin-screen[hidden] {
  display: none !important;
}

.is-screen-locked {
  overflow: hidden;
}

.workspace-ui-blocker {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  z-index: 220;
}

.workspace-ui-blocker[hidden] {
  display: none !important;
}

.workspace-ui-blocker-card {
  width: min(460px, 94vw);
  background: #ffffff;
  border: 1px solid #dbe7ff;
  border-radius: 0.9rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  padding: 1.15rem 1.15rem 1rem;
  text-align: center;
}

.workspace-ui-blocker-card h3 {
  color: #0f2f74;
  margin-bottom: 0.3rem;
}

.workspace-ui-blocker-card p {
  color: #334155;
}

.workspace-ui-spinner {
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: #1d4ed8;
  animation: workspace-spin 0.9s linear infinite;
}

.workspace-ui-progress {
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 0.75rem;
}

.workspace-ui-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  transition: width .25s ease;
}

.workspace-ui-progress-value {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e3a8a;
}

@keyframes workspace-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.admin-panel-modal {
  width: min(1040px, 96vw);
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  margin-bottom: 0;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.form-inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.6rem;
}

.admin-form select[multiple] {
  min-height: 105px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem;
}

.admin-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.btn-table {
  width: auto;
  padding: 0.35rem 0.65rem;
  margin-right: 0.35rem;
}

.btn-table.danger {
  border-color: #ef4444;
  color: #dc2626;
}

.btn-table.danger:hover {
  background: #ef4444;
  color: #ffffff;
}

@media (max-width: 980px) {
  .landing-header {
    grid-template-columns: 1fr;
  }

  .access-box {
    max-width: 480px;
    justify-self: end;
    width: 100%;
  }

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

  .binder-body {
    grid-template-columns: 1fr;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .form-inline-checkbox {
    margin-top: 0.2rem;
  }

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

  .kpi-startup-grid {
    grid-template-columns: 1fr;
  }

  .kpi-demo-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

@media (max-width: 640px) {
  .page-landing {
    padding: 0.95rem;
  }

  .brand-panel,
  .access-box,
  .hero-copy,
  .target-section {
    padding: 1rem;
  }

  .language-flags { padding: 0.3rem 0.4rem; }

  .access-box {
    justify-self: stretch;
  }
}

/* =========================================================================
   Export / Import dropdown menu
   ========================================================================= */

.export-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.export-dropdown {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e0e7ef;
  border-radius: 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .13);
  z-index: 200;
  padding: 0.35rem 0;
  display: none;
}

.export-dropdown.is-open {
  display: block;
}

.export-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.88rem;
  cursor: pointer;
  color: #374151;
  line-height: 1.4;
}

.export-dropdown-item:hover:not(:disabled) {
  background: #f0f4ff;
  color: var(--accent, #6d28d9);
}

.export-dropdown-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.export-import-item {
  color: #b45309;
  font-weight: 600;
}

.export-import-item:hover:not(:disabled) {
  background: #fffbeb;
  color: #92400e;
}

.export-dropdown-divider {
  height: 0;
  margin: 0.3rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

#export-menu-btn[aria-expanded="true"] {
  background: var(--accent, #6d28d9);
  color: #fff;
  border-color: var(--accent, #6d28d9);
}

/* =========================================================================
   Control Tower page
   ========================================================================= */

.page-control-tower {
  min-height: 100vh;
  background: var(--bg);
}

.ct-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.ct-header {
  margin-bottom: 2rem;
  padding: 1.75rem 1.85rem;
  background:
    radial-gradient(circle at top right, rgba(29, 78, 216, .12), transparent 34%),
    linear-gradient(145deg, #ffffff, #f8fbff);
  border: 1px solid rgba(29, 78, 216, .12);
  border-radius: 1.2rem;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

.ct-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.ct-lead {
  margin-top: 0.45rem;
  font-size: 1rem;
  color: #475569;
}

.ct-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.ct-empty {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
}

.ct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.ct-tile {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  min-height: 240px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(242, 247, 255, .96));
  border: 1px solid rgba(29, 78, 216, .14);
  border-radius: 1.25rem;
  padding: 1.6rem;
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease,
    transform 0.15s ease;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.ct-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(29, 78, 216, .14);
  transform: translateY(-4px);
}

.ct-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ct-tile:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.ct-module-tile::after {
  content: '';
  position: absolute;
  right: -42px;
  bottom: -52px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(29, 78, 216, .08);
}

.ct-tile-avatar {
  flex-shrink: 0;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 24px rgba(29, 78, 216, .24);
}

.ct-tile-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.ct-module-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.ct-tile-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.ct-tile-description {
  font-size: 0.96rem;
  color: #334155;
  line-height: 1.55;
  max-width: 36ch;
  margin-bottom: 1rem;
}

.ct-tile-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 30ch;
}

.ct-tile-arrow {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--accent);
  transition: color 0.15s, transform 0.15s;
  position: relative;
  z-index: 1;
}

.ct-tile:hover .ct-tile-arrow {
  color: var(--accent);
  transform: translateX(6px);
}

/* CRM page */
.page-crm {
  min-height: 100vh;
  background: var(--bg);
}

.crm-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.crm-header {
  margin-bottom: 1.5rem;
}

.crm-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
}

.crm-title {
  margin-top: 0.35rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.15rem;
  line-height: 1.15;
}

.crm-subtitle {
  margin-top: 0.45rem;
  color: var(--text-muted);
}

.crm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.crm-summary-card,
.crm-panel,
.crm-card {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.crm-summary-card {
  padding: 1.15rem 1.2rem;
}

.crm-summary-label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.crm-summary-value {
  display: block;
  margin-top: 0.3rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

.crm-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.crm-layout-single {
  grid-template-columns: 1fr;
}

.crm-panel {
  padding: 1.35rem;
}

.crm-panel-head {
  margin-bottom: 1rem;
}

.crm-panel-head h2,
.crm-section-head h3 {
  margin-bottom: 0.2rem;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.crm-select,
.crm-textarea,
.crm-relations-list input,
.crm-relations-list select {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #fff;
  font: inherit;
}

.crm-textarea {
  min-height: 110px;
  resize: vertical;
}

.crm-relations {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.crm-relations-head,
.crm-section-head,
.crm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.crm-relations-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.crm-relation-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
}

.crm-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.7rem;
  color: #334155;
}

.crm-form-actions {
  margin-top: 1rem;
}

.crm-form-actions .btn {
  min-width: 180px;
}

.crm-toolbar {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.crm-search-group {
  flex: 1;
  margin-bottom: 0;
}

.crm-list-panel-full {
  min-height: 420px;
}

.crm-registry-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-registry-card .crm-card-head .btn {
  min-width: 96px;
}

.crm-detail-shell {
  max-width: 980px;
}

.crm-detail-panel {
  padding: 1.5rem;
}

.crm-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crm-registry-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.crm-card-list {
  display: grid;
  gap: 0.9rem;
}

.crm-card {
  padding: 1rem;
}

.crm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, .12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.crm-badge-person {
  background: rgba(245, 158, 11, .16);
  color: #b45309;
}

.crm-card h4 {
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}

.crm-card-subtitle,
.crm-card-notes {
  color: #475569;
  font-size: 0.92rem;
}

.crm-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.crm-card-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.crm-card-meta dd {
  margin-top: 0.2rem;
  color: var(--text);
  word-break: break-word;
}

.crm-relations-preview strong {
  display: block;
  margin-bottom: 0.45rem;
}

.crm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.crm-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
}

.crm-empty,
.crm-empty-inline {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .ct-shell {
    padding: 1.25rem 1rem 3rem;
  }

  .ct-title {
    font-size: 1.5rem;
  }

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

  .crm-shell {
    padding: 1.25rem 1rem 3rem;
  }

  .crm-summary,
  .crm-layout,
  .crm-registry-columns,
  .crm-registry-list,
  .crm-form-grid,
  .crm-relation-row {
    grid-template-columns: 1fr;
  }

  .crm-toolbar,
  .crm-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
