/* CommunityNeedsBoard Stylesheet - Musechain Office Aesthetic */
@font-face {
  font-family: 'Geist';
  src: url('https://musechain.io/fonts/geist/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #fbfbf9;
  --bg-surface: #ffffff;
  --bg-elevated: #f4f5f0;
  --border-subtle: #e6e7df;
  --border-strong: #1b1e16;
  --text-main: #11140e;
  --text-muted: #5e6456;
  --text-faint: #8f9686;
  --brand-lime: #ccff00;
  --brand-lime-hover: #b8e600;
  --brand-lime-pale: #f4fed2;
  --brand-dark: #0f140d;
  --status-open-bg: #eefee8;
  --status-open-fg: #1d7313;
  --status-prog-bg: #fffde0;
  --status-prog-fg: #8a6e00;
  --status-res-bg: #eaf1fb;
  --status-res-fg: #1b59a6;
  --danger-bg: #feeceb;
  --danger-fg: #b3261e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: var(--brand-dark);
  color: #fff;
  border-bottom: 2px solid var(--brand-lime);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.avatar-tag {
  background: var(--brand-lime);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.crumb-separator {
  color: #555e50;
}

.office-tag {
  color: #a4ae9d;
  font-size: 0.85rem;
}

.board-title {
  color: #ffffff;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-pill {
  color: #cfd8ca;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.contract-pill {
  font-family: monospace;
  border: 1px solid rgba(204, 255, 0, 0.4);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-lime);
  box-shadow: 0 0 6px var(--brand-lime);
}

/* Zero-Value Safety Banner */
.safety-banner {
  background-color: var(--brand-lime-pale);
  border-bottom: 1px solid #d7e89c;
  padding: 10px 24px;
}

.safety-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.84rem;
}

.safety-badge {
  background-color: var(--brand-dark);
  color: var(--brand-lime);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.safety-text {
  color: #3b4528;
}

.safety-text strong {
  color: #1a220f;
}

/* Layout */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

/* Hero Section */
.hero-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.department-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.15;
}

.hero-subtitle {
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-weight: 600;
}

.meta-val {
  font-size: 0.88rem;
  color: var(--text-main);
}

.meta-val.code {
  font-family: monospace;
  color: #0b60b0;
  text-decoration: none;
}

.meta-val.code:hover {
  text-decoration: underline;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 170px;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--brand-lime);
  color: var(--brand-dark);
  border-color: #b5e400;
  box-shadow: 0 2px 0 #9fcc00;
}

.btn-primary:hover {
  background-color: var(--brand-lime-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
}

.btn-endorse {
  background-color: var(--brand-dark);
  color: var(--brand-lime);
  padding: 12px 20px;
  font-size: 0.95rem;
  width: 100%;
}

.btn-endorse:hover:not(:disabled) {
  background-color: #212c1d;
}

.btn-endorse:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #555d4e;
  color: #ccc;
}

/* Board Toolbar */
.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  font-size: 0.82rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
}

/* Board Layout */
.board-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.need-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.need-card:hover {
  border-color: #b9beaf;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.need-card.selected {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px var(--brand-dark);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.card-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dept-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid #e0e2d7;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.open {
  background-color: var(--status-open-bg);
  color: var(--status-open-fg);
}

.status-badge.in-progress {
  background-color: var(--status-prog-bg);
  color: var(--status-prog-fg);
}

.status-badge.resolved {
  background-color: var(--status-res-bg);
  color: var(--status-res-fg);
}

.endorse-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f3ec;
  color: var(--text-main);
}

.endorse-count.active {
  background: var(--brand-lime-pale);
  color: #3b5200;
  border: 1px solid #c7e87b;
}

.card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  padding-top: 10px;
  border-top: 1px solid #f2f3ed;
}

.author-link {
  font-weight: 600;
  color: var(--text-muted);
}

/* Detail Drawer Panel */
.detail-column {
  position: sticky;
  top: 20px;
}

.detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.empty-detail-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.4rem;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.empty-detail-state h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-detail-state p {
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Detail Active Content */
.detail-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.detail-req-id {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.detail-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 8px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.detail-section {
  margin-bottom: 18px;
}

.section-h4 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
  font-weight: 700;
}

.detail-desc-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-line;
}

.resolution-box {
  background: #f6f8fa;
  border-left: 3px solid #1b59a6;
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
}

.resolution-box.in-progress {
  border-left-color: #8a6e00;
  background: #fefdf6;
}

.resolution-box.open {
  border-left-color: var(--brand-lime-hover);
  background: #fafdf2;
}

.action-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 18px;
}

.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.action-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.action-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.already-endorsed-banner {
  background: #eef9e4;
  border: 1px solid #bcdca6;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: #274b12;
  display: flex;
  align-items: center;
  gap: 8px;
}

.endorse-toggle-area {
  margin-top: 12px;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 13, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: 0 16px 36px rgba(0,0,0,0.2);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  animation: modalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px 24px 24px;
}

.form-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px rgba(204, 255, 0, 0.5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 4px;
  display: block;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--brand-dark);
  color: #fff;
  border-left: 4px solid var(--brand-lime);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn 0.2s ease;
}

.toast.toast-error {
  border-left-color: var(--danger-fg);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.page-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px;
  margin-top: 48px;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-info p {
  color: var(--text-muted);
}

.footer-info a {
  color: var(--text-main);
  text-decoration: underline;
}

.footer-sub {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .board-layout {
    grid-template-columns: 1fr;
  }
  .detail-column {
    position: static;
  }
  .hero-section {
    flex-direction: column;
  }
  .hero-actions {
    width: 100%;
    flex-direction: row;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}