@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=Lato:wght@400;700&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:           #F4F4F0;
  --surface:      #FFFFFF;
  --surface2:     #F0EFEB;
  --border:       rgba(0,0,0,0.08);
  --border-active:rgba(0,0,0,0.15);

  --pink:         #E82AAE;
  --pink-light:   rgba(232,42,174,0.08);
  --teal:         #26EA9F;
  --teal-text:    #0A8A5C;
  --teal-light:   rgba(38,234,159,0.12);

  --text:         #1A1A1A;
  --muted:        #666666;
  --dim:          #C0BFBB;

  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.10), 0 3px 8px rgba(0,0,0,0.06);

  --transition:   all 0.2s cubic-bezier(0.16,1,0.3,1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Jost', sans-serif; line-height: 1.25; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--muted); font-size: 0.9375rem; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Nav / Header ────────────────────────────────────────────────────────── */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 0;
  margin-bottom: 32px;
}
.app-logo {
  font-family: 'Jost', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.app-logo span { color: var(--pink); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ── BU Toggle ───────────────────────────────────────────────────────────── */
.bu-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bu-btn {
  padding: 6px 14px;
  border-radius: 100px;
  font-family: 'Jost', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.bu-btn:hover { border-color: var(--border-active); color: var(--text); }
.bu-btn.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

/* ── Section heading ─────────────────────────────────────────────────────── */
.section-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
.section-title {
  margin-bottom: 4px;
}
.section-sub {
  margin-bottom: 28px;
  font-size: 0.9375rem;
}

/* ── Skill Cards Grid ────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.skill-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.skill-card:active { transform: translateY(-1px); }

.skill-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.skill-card-title {
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.skill-card-situation {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}
.skill-card-arrow {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Secondary link ──────────────────────────────────────────────────────── */
.text-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}
.text-link:hover { color: var(--text); }

/* ── Buttons ──────────────────────────────────────────────────────────────  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--pink);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary {
  background: var(--surface);
  border: 1.5px solid var(--border-active);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--text); background: var(--surface2); }
.btn-ghost {
  color: var(--muted);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--surface2); border-radius: var(--radius-sm); }
.btn-teal {
  background: var(--teal);
  color: var(--text);
}
.btn-teal:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ── Back button ─────────────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 0;
  margin-bottom: 20px;
  transition: var(--transition);
}
.back-btn:hover { color: var(--text); }

/* ── Skill Runner ────────────────────────────────────────────────────────── */
.skill-runner-header {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 16px;
}
.skill-runner-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.skill-runner-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.skill-runner-title { font-size: 1.5rem; margin-bottom: 4px; }
.skill-runner-desc { font-size: 0.9rem; }

.skill-runner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Instruction panels ──────────────────────────────────────────────────── */
.instruction-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.instruction-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.instruction-panel-header:hover { background: var(--surface2); }
.instruction-panel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.instruction-panel-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--pink-light);
  color: var(--pink);
}
.instruction-panel-badge.secondary {
  background: var(--surface2);
  color: var(--muted);
}
.instruction-panel-chevron {
  color: var(--dim);
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}
.instruction-panel.open .instruction-panel-chevron { transform: rotate(180deg); }
.instruction-panel-body {
  display: none;
  padding: 0 20px 20px;
}
.instruction-panel.open .instruction-panel-body { display: block; }

.step-list {
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}
.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.step-num {
  counter-increment: steps;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink);
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-content { flex: 1; }
.step-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.step-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  color: var(--text);
  margin-top: 6px;
  word-break: break-all;
}

/* ── BU Tip ──────────────────────────────────────────────────────────────── */
.bu-tip {
  background: var(--teal-light);
  border: 1.5px solid rgba(38,234,159,0.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.bu-tip-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.bu-tip-text { font-size: 0.875rem; color: var(--teal-text); font-weight: 500; margin: 0; }
.bu-tip-text strong { color: var(--teal-text); }

/* ── Feedback widget ─────────────────────────────────────────────────────── */
.feedback-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}
.feedback-section h4 {
  margin-bottom: 4px;
}
.feedback-section > p {
  font-size: 0.875rem;
  margin-bottom: 14px;
}
.feedback-rating {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.feedback-rating-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  transition: var(--transition);
  background: var(--surface);
}
.feedback-rating-btn:hover { border-color: var(--border-active); color: var(--text); }
.feedback-rating-btn.selected-up {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-text);
}
.feedback-rating-btn.selected-down {
  border-color: var(--pink);
  background: var(--pink-light);
  color: var(--pink);
}

.feedback-form { display: flex; flex-direction: column; gap: 10px; }
.feedback-form textarea,
.feedback-form input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-family: 'Lato', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  transition: var(--transition);
  outline: none;
}
.feedback-form textarea:focus,
.feedback-form input:focus { border-color: var(--pink); }
.feedback-form textarea { min-height: 80px; }
.feedback-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}
.feedback-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-text);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 0 0;
}

/* ── Prompt Library ──────────────────────────────────────────────────────── */
.prompt-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.prompt-filter-btn {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.prompt-filter-btn:hover { border-color: var(--border-active); color: var(--text); }
.prompt-filter-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.prompts-list { display: flex; flex-direction: column; gap: 10px; }
.prompt-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: var(--transition);
}
.prompt-card:hover { border-color: var(--border-active); box-shadow: var(--shadow-sm); }
.prompt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.prompt-card-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
}
.prompt-card-skill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.prompt-card-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  gap: 8px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: var(--transition);
  background: var(--surface);
}
.copy-btn:hover { border-color: var(--pink); color: var(--pink); }
.copy-btn.copied { border-color: var(--teal); color: var(--teal-text); background: var(--teal-light); }

/* ── Submit prompt form ──────────────────────────────────────────────────── */
.submit-prompt-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1.5px solid var(--border);
}
.submit-form {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-family: 'Lato', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--pink); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}
.admin-tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: calc(var(--radius) - 4px);
  font-family: 'Jost', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: var(--transition);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { background: var(--text); color: #fff; }

.admin-table-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1.5px solid var(--border);
}
.admin-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface2); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-badge.active { background: var(--teal-light); color: var(--teal-text); }
.status-badge.inactive { background: var(--surface2); color: var(--muted); }
.status-badge.pending { background: rgba(255,170,0,0.12); color: #8a5e00; }

.table-actions { display: flex; gap: 6px; }

/* ── Admin skill editor modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 1.25rem; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: var(--transition);
  font-size: 1.2rem;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  max-width: 380px;
  margin: 80px auto 0;
}
.login-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.login-card h2 { margin-bottom: 6px; }
.login-card > p { margin-bottom: 24px; }

/* ── Tabs (library/admin secondary nav) ──────────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 28px;
}
.view-tab {
  padding: 10px 18px;
  font-family: 'Jost', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: var(--transition);
}
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--pink); border-bottom-color: var(--pink); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--teal-text); }
.toast.error { background: #c0392b; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { height: 1.5px; background: var(--border); margin: 28px 0; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-pink { color: var(--pink); }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.font-jost { font-family: 'Jost', sans-serif; }
.fw-600 { font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .app-shell { padding: 0 16px 60px; }
  .skills-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  h1 { font-size: 1.5rem; }
  .modal { padding: 24px 20px; }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; }
}
