/* nxzen CSAT — shared dashboard styles (used by every internal page) */

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F4F2EC;
  --ink: #1A1A1A;
  --ink-muted: #555555;
  --ink-faint: #8A8A8A;
  --nxzen-green: #A5E635;
  --nxzen-green-dark: #7BB820;
  --nxzen-green-tint: #ECFAD0;
  --warn: #BA7517;
  --warn-tint: #FAEEDA;
  --danger: #A32D2D;
  --danger-tint: #FCEBEB;
  --border: rgba(26, 26, 26, 0.10);
  --border-strong: rgba(26, 26, 26, 0.18);
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter Tight', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html, body {
  background: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.brand-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--nxzen-green); }
.brand-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 24px 16px;
  margin-bottom: 8px;
}
.nav-item {
  padding: 10px 24px;
  font-size: 13.5px;
  color: var(--ink-muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active {
  color: var(--ink);
  font-weight: 500;
  border-left-color: var(--nxzen-green);
  background: var(--bg);
}
.nav-icon { width: 14px; height: 14px; opacity: 0.7; flex-shrink: 0; }

.sidebar-footer {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.sidebar-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
}

/* === MAIN === */
.main { padding: 32px 40px 60px; max-width: 1400px; }

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.header-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.header-sub { font-size: 13px; color: var(--ink-muted); }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--border-strong); }
.filter-pill.active {
  background: var(--nxzen-green);
  color: var(--ink);
  border-color: var(--nxzen-green);
  font-weight: 500;
}

/* === HERO METRICS === */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.metric-card.featured { background: var(--ink); color: white; border-color: var(--ink); }
.metric-card.featured .metric-label,
.metric-card.featured .metric-meta { color: rgba(255,255,255,0.65); }
.metric-card.featured .metric-value { color: white; }
.metric-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.metric-value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.metric-value .unit {
  font-size: 18px;
  color: var(--ink-faint);
  margin-left: 4px;
  font-family: var(--sans);
  font-weight: 400;
  font-style: normal;
}
.metric-card.featured .metric-value .unit { color: rgba(255,255,255,0.5); }
.metric-meta { font-size: 12px; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }

/* === PANELS === */
.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-grid.even { grid-template-columns: 1fr 1fr; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px 28px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.panel-title { font-family: var(--serif); font-style: italic; font-size: 18px; font-weight: 500; }
.panel-sub { font-size: 12px; color: var(--ink-faint); }

.chart-wrap { position: relative; height: 240px; }
.chart-wrap.tall { height: 280px; }

/* NPS distribution bars */
.nps-bars { display: flex; flex-direction: column; gap: 14px; }
.nps-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.nps-bar-label { color: var(--ink); font-weight: 500; }
.nps-bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.nps-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.nps-bar-fill.promoter { background: var(--nxzen-green); }
.nps-bar-fill.passive { background: var(--ink-faint); }
.nps-bar-fill.detractor { background: var(--danger); }
.nps-bar-pct {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* categorical breakdown */
.cat-list { display: flex; flex-direction: column; gap: 14px; }
.cat-row {
  display: grid;
  grid-template-columns: 100px 1fr 50px;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.cat-label { color: var(--ink); font-weight: 500; }
.cat-track {
  height: 24px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.cat-fill {
  height: 100%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cat-fill.excellent { background: var(--nxzen-green); }
.cat-fill.good { background: var(--nxzen-green-tint); }
.cat-fill.warn { background: var(--warn-tint); color: var(--warn); }
.cat-fill.bad { background: var(--danger-tint); color: var(--danger); }
.cat-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* tables */
.responses-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.responses-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.responses-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.responses-table tr:hover td { background: var(--bg); }
.responses-table .client { font-weight: 500; }
.responses-table .project { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.badge-promoter { background: var(--nxzen-green-tint); color: var(--nxzen-green-dark); }
.badge-passive { background: var(--surface-alt); color: var(--ink-muted); }
.badge-detractor { background: var(--danger-tint); color: var(--danger); }

.score-cell {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.score-cell.high { color: var(--nxzen-green-dark); }
.score-cell.mid { color: var(--ink-muted); }
.score-cell.low { color: var(--danger); }
.date-mono { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.risk-dot { color: var(--danger); margin-left: 6px; }

/* ranked list */
.theme-list { display: flex; flex-direction: column; gap: 12px; }
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.theme-row:last-child { border-bottom: none; }
.theme-name { font-size: 13.5px; font-weight: 500; }
.theme-count { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); }
.theme-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.theme-tag.positive { background: var(--nxzen-green-tint); color: var(--nxzen-green-dark); }
.theme-tag.negative { background: var(--danger-tint); color: var(--danger); }
.theme-tag.mixed { background: var(--warn-tint); color: var(--warn); }

/* quotes */
.quote-card { padding: 16px 0; border-bottom: 1px solid var(--border); }
.quote-card:last-child { border-bottom: none; }
.quote-text {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 8px;
}
.quote-meta { font-size: 12px; color: var(--ink-faint); display: flex; gap: 8px; align-items: center; }
.quote-meta-sep::before { content: '·'; }

/* alert */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--nxzen-green-tint);
  border-left: 3px solid var(--nxzen-green);
  border-radius: 3px;
  margin-bottom: 24px;
  font-size: 13px;
}
.alert.warn { background: var(--warn-tint); border-left-color: var(--warn); }
.alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert strong { font-weight: 500; }

.section-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0 16px; }
.section-divider-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-muted);
  font-weight: 500;
}
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
}
.muted-note { font-size: 12px; color: var(--ink-faint); font-style: italic; padding: 8px 0; }

/* === FORM CONTROLS (search, settings) === */
.text-input,
.select-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: all 0.15s;
}
.text-input:focus,
.select-input:focus {
  border-color: var(--nxzen-green);
  box-shadow: 0 0 0 3px var(--nxzen-green-tint);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  border: 1px solid var(--ink);
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--nxzen-green-dark); border-color: var(--nxzen-green-dark); }
.btn.secondary { background: var(--surface); color: var(--ink); }
.btn.secondary:hover { background: var(--bg); border-color: var(--border-strong); }

/* === OPEN RESPONSES — text answer cards === */
.answer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 14px;
}
.answer-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.answer-client { font-weight: 500; font-size: 14px; }
.answer-project { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.answer-block { margin-top: 12px; }
.answer-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.answer-label.positive { color: var(--nxzen-green-dark); }
.answer-label.negative { color: var(--danger); }
.answer-text {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

/* === BY CLIENT — client cards === */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
}
.client-card.at-risk { border-color: var(--danger); border-left: 3px solid var(--danger); }
.client-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.client-card-name { font-family: var(--serif); font-style: italic; font-size: 20px; font-weight: 500; }
.client-card-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.client-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.client-stat-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.client-stat-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.client-projects { font-size: 12px; color: var(--ink-muted); margin-top: 8px; line-height: 1.6; }

/* === SETTINGS === */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.setting-desc { font-size: 12px; color: var(--ink-faint); }
.setting-control { flex-shrink: 0; min-width: 200px; display: flex; gap: 8px; justify-content: flex-end; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink);
  color: white;
  padding: 12px 22px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .panel-grid, .panel-grid.even { grid-template-columns: 1fr; }
}
