/* Teleion Engagement Health — Global Styles */
/* Brand: green #b1c50a, gray #7a756f, font: Segoe UI */

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

:root {
  --green: #b1c50a;
  --green-dark: #8a9808;
  --green-light: #eef1c0;
  --green-text: #3a4802;
  --gray: #7a756f;
  --gray-dark: #3a3632;
  --gray-light: #e8e5e1;
  --gray-lighter: #f5f4f2;
  --white: #ffffff;
  --border: #d8d4cf;
  --red-light: #fde8e8;
  --red: #8a2020;
  --amber-light: #fdf3d8;
  --amber: #7a5010;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-lighter);
  color: var(--gray-dark);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* App shell */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* Top nav */
.nav {
  background: var(--gray);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { height: 28px; }
.nav-title { color: #fff; font-size: 15px; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-quarter { color: #d4d1ce; font-size: 12px; }
.nav-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.nav-user-name { color: #fff; font-size: 13px; font-weight: 500; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #5a5652;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-lg {
  width: 40px; height: 40px; font-size: 14px;
}

/* Sidebar nav */
.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
  width: 200px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--gray-dark);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--gray-lighter); }
.sidebar-link.active {
  border-left-color: var(--green);
  background: var(--green-light);
  color: var(--green-text);
  font-weight: 600;
}
.sidebar-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-section {
  font-size: 10px; font-weight: 700; color: var(--gray);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 12px 20px 4px;
}

/* Main content */
.main { flex: 1; overflow-y: auto; padding: 20px; }
.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--gray-dark); }
.page-sub { font-size: 13px; color: var(--gray); margin-top: 2px; }

/* Cards */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-sm { padding: 12px; }

/* Stat grid */
.stat-grid { display: grid; gap: 8px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
}
.stat-val { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 10px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.stat-sub { font-size: 11px; font-weight: 600; margin-top: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--green); color: var(--gray-dark); }
.btn-secondary { background: var(--gray); color: #fff; }
.btn-ghost { background: var(--gray-light); color: var(--gray-dark); }
.btn-danger { background: #e85050; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; font-weight: 700; width: 100%; justify-content: center; }

/* Toggle buttons (radio-style) */
.toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--gray-light);
  color: var(--gray-dark);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.toggle-btn:hover { border-color: var(--gray); }
.toggle-btn.active-green { background: var(--green-light) !important; color: var(--green-text) !important; border-color: var(--green-dark) !important; }
.toggle-btn.active-gray { background: var(--gray-light) !important; color: var(--gray-dark) !important; border-color: var(--gray) !important; outline: 2px solid var(--gray); }

/* Form fields */
.field { margin-bottom: 16px; }
.field-label { font-size: 11px; font-weight: 700; color: var(--gray-dark); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: block; }
.field-hint { font-size: 11px; color: var(--gray); margin-bottom: 6px; font-weight: 500; line-height: 1.5; }
.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  background: #f9f8f6;
  color: var(--gray-dark);
  transition: border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green-dark); }
.textarea { resize: vertical; min-height: 80px; }

/* Radio options */
.radio-opts { display: flex; flex-direction: column; gap: 6px; }
.radio-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
}
.radio-opt:hover { border-color: var(--green-dark); background: #f9faf0; }
.radio-opt.selected { border-color: var(--green-dark); background: var(--green-light); }
.radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.radio-opt.selected .radio-dot { border-color: var(--green-dark); background: var(--green-dark); }
.radio-dot::after {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: #fff; display: none;
}
.radio-opt.selected .radio-dot::after { display: block; }
.radio-text { font-size: 13px; font-weight: 500; }
.radio-text small { display: block; font-size: 11px; color: var(--gray); margin-top: 1px; font-weight: 400; }

/* Checkbox options */
.check-opts { display: flex; flex-direction: column; gap: 6px; }
.check-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
}
.check-opt:hover { border-color: var(--green-dark); background: #f9faf0; }
.check-opt.selected { border-color: var(--green-dark); background: var(--green-light); }
.check-box {
  width: 16px; height: 16px; border-radius: 4px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.check-opt.selected .check-box { border-color: var(--green-dark); background: var(--green-dark); }
.check-text { font-size: 13px; font-weight: 500; }

/* NPS Score buttons */
.score-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.score-btn {
  padding: 9px 0;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  border: 1.5px solid transparent;
  transition: opacity .15s;
}
.score-btn:hover { opacity: .75; }
.score-btn.detractor { background: #fde8e8; color: #8a2020; border-color: #f0b0b0; }
.score-btn.passive   { background: #fdf3d8; color: #7a5010; border-color: #f0d890; }
.score-btn.promoter  { background: var(--green-light); color: var(--green-text); border-color: var(--green); }
.score-btn.selected  { outline: 3px solid var(--gray-dark); outline-offset: 2px; }
.score-labels { display: flex; justify-content: space-between; margin-top: 5px; }
.score-labels span { font-size: 10px; color: var(--gray); font-weight: 600; }

/* Pills / badges */
.pill {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.pill-new      { background: var(--green-light); color: var(--green-text); border: 1px solid var(--green); }
.pill-ongoing  { background: var(--gray-light);  color: var(--gray-dark);  border: 1px solid var(--gray); }
.pill-close    { background: #fde8e8; color: #8a2020; border: 1px solid #f0b0b0; }
.pill-done     { background: #f0f0ee; color: var(--gray); border: 1px solid var(--border); }
.pill-new-tag  { background: #d8e006; color: #2a3002; }
.pill-ended    { background: #fde8e8; color: #6a1a1a; }

/* Score pill */
.score-pill {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  min-width: 42px; text-align: center;
}

/* Engagement cards (hub) */
.eng-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color .15s;
}
.eng-card:hover { border-color: var(--green-dark); }
.eng-card-top {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.eng-info { flex: 1; min-width: 0; }
.eng-name { font-size: 13px; font-weight: 700; color: var(--gray-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng-client { font-size: 11px; color: var(--gray); margin-top: 2px; }
.eng-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--gray-light);
}
.action-cell {
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: background .15s;
}
.action-cell:hover { background: var(--gray-lighter); }
.action-cell:first-child { border-right: 1px solid var(--gray-light); }
.action-label { font-size: 12px; font-weight: 600; color: var(--gray-dark); }
.action-status { font-size: 11px; font-weight: 500; margin-top: 2px; }
.status-todo { color: var(--green-dark); }
.status-done { color: var(--gray); }
.check-sm {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.todo-sm {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--green);
  flex-shrink: 0;
}
.todo-gray {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Engagement context banner (on survey/NPS screens) */
.eng-context {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.eng-context.new-project  { border-color: var(--green); }
.eng-context.project-close { border-color: #f0b0b0; }
.eng-context-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.meta-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--gray-light); color: var(--gray-dark); }
.meta-tag-green { background: var(--green-light); color: var(--green-text); }
.meta-tag-red { background: #fde8e8; color: #8a2020; }

/* Progress bar */
.progress-wrap { margin-bottom: 14px; }
.progress-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.progress-row span { font-size: 12px; color: var(--gray); font-weight: 600; }
.progress-bg { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }

/* Alert banners */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  margin-bottom: 14px; font-size: 13px; font-weight: 500;
}
.alert-amber { background: #faeeda; border: 1px solid #e8c870; color: #5a3a10; }
.alert-red   { background: #fde8e8; border: 1px solid #f0b0b0; color: #6a1a1a; }
.alert-green { background: var(--green-light); border: 1px solid var(--green); color: var(--green-text); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-action { margin-left: auto; font-weight: 700; cursor: pointer; text-decoration: underline; white-space: nowrap; }

/* Section label */
.section-label {
  font-size: 11px; font-weight: 700; color: var(--gray);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 8px;
}

/* Divider */
.divider { height: 1px; background: var(--gray-light); margin: 16px 0; }

/* Loading */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 12px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notifications */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  opacity: 0; transition: all .3s; z-index: 9999;
  white-space: nowrap; max-width: 90vw;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--gray-dark); color: #fff; }
.toast-error   { background: #e85050; color: #fff; }
.toast-info    { background: var(--gray); color: #fff; }

/* History rows (NPS) */
.history-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-light); }
.history-row:last-child { border-bottom: none; }
.history-score { font-size: 20px; font-weight: 700; color: var(--green-dark); min-width: 28px; }
.history-meta { flex: 1; }
.history-quarter { font-size: 12px; font-weight: 600; color: var(--gray-dark); }
.history-comment { font-size: 11px; color: var(--gray); margin-top: 2px; font-style: italic; }

/* PO review cards */
.po-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px;
  transition: border-color .15s;
}
.po-card.decided { border-color: var(--green-dark); }
.po-name { font-size: 13px; font-weight: 700; color: var(--gray-dark); }
.po-meta { font-size: 11px; color: var(--gray); margin-top: 3px; }
.sub-section { background: var(--green-light); border-radius: 8px; padding: 12px; border: 1.5px solid var(--green); margin-top: 8px; }
.sub-section.gray-bg { background: var(--gray-light); border-color: var(--gray); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 10px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--gray-light); text-align: left; }
.data-table td { font-size: 13px; padding: 9px 10px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-lighter); }
.data-table tr:last-child td { border-bottom: none; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Login screen */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gray-lighter);
}
.login-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 40px; text-align: center;
  max-width: 400px; width: 90%;
}
.login-logo { height: 48px; margin-bottom: 16px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--gray); margin-bottom: 28px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .stat-grid-4, .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .eng-actions { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(6, 1fr); }
}
