/* HS Inc Operations Hub - Mobile-First Clean Design */

:root {
  --bg-primary: #0a0a0a;
  --bg-card: #ffffff;
  --bg-card-alt: #f8f9fa;
  --border-color: #e5e7eb;
  --text-dark: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent-primary: #10b981;
  --accent-secondary: #059669;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-info: #3b82f6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50%;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
  --bottom-nav-height: 64px;
  --header-height: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: #ffffff;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-height);
}

/* Hide sidebar on mobile, show on desktop */
.sidebar {
  display: none;
}

/* Main content - full width on mobile */
.content {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.last-updated {
  font-size: 12px;
  color: var(--text-muted);
}

/* Cards - White on dark, like Lloyds */
.card, .stat-card, .idea-card, .pipeline-stat {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  color: var(--text-dark);
  box-shadow: var(--shadow-card);
}

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

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.card-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* Stats Grid */
.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateX(4px);
}

.stat-card::after {
  content: '→';
  margin-left: auto;
  color: var(--accent-primary);
  font-size: 18px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.agents { background: #6366f1; }
.stat-icon.projects { background: #8b5cf6; }
.stat-icon.ideas { background: #f59e0b; }
.stat-icon.treasury { background: #10b981; }

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* List items inside cards */
.card-body {
  color: var(--text-dark);
}

.agent-item, .idea-item, .activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.agent-item:last-child, .idea-item:last-child, .activity-item:last-child {
  border-bottom: none;
}

.agent-avatar, .idea-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: 600;
}

.agent-info, .idea-info {
  flex: 1;
}

.agent-name, .idea-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 15px;
}

.agent-owner, .idea-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.online {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.offline {
  background: #fee2e2;
  color: #b91c1c;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-item .icon {
  font-size: 22px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-secondary);
}

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-refresh {
  background: transparent;
  color: #ffffff;
  border: 1px solid #333;
  padding: 8px 16px;
  font-size: 13px;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
}

/* Ideas Page - Kanban on desktop, list on mobile */
.kanban-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-column {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kanban-header {
  padding: 12px 16px;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.kanban-count {
  background: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.kanban-cards {
  padding: 8px;
}

.idea-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.idea-card:hover {
  border-color: var(--accent-primary);
}

.idea-card-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 8px;
}

.idea-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.idea-card-score {
  background: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.idea-card-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.idea-tag {
  background: #e5e7eb;
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* Pipeline Stats */
.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.pipeline-stat {
  text-align: center;
  padding: 12px 8px;
  cursor: pointer;
}

.pipeline-stat:hover {
  background: var(--bg-card-alt);
}

.pipeline-stat-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.pipeline-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Score buttons */
.score-buttons {
  display: flex;
  gap: 6px;
}

.score-buttons button {
  flex: 1;
  padding: 10px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.score-buttons button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* Decision buttons */
.decision-btn {
  padding: 12px 20px;
  border: 2px solid;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
}

.decision-btn.build {
  border-color: var(--accent-success);
  color: var(--accent-success);
}

.decision-btn.build.active {
  background: var(--accent-success);
  color: white;
}

/* Treasury/Agents/Projects specific */
.treasury-balance {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Desktop styles */
@media (min-width: 768px) {
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    flex-direction: column;
    z-index: 100;
  }
  
  .content {
    margin-left: 240px;
    max-width: none;
    padding: 24px 32px;
    padding-bottom: 32px;
  }
  
  .bottom-nav {
    display: none;
  }
  
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .dashboard-grid .full-width {
    grid-column: 1 / -1;
  }
  
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
  
  .pipeline-stats {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .modal {
    border-radius: var(--radius-lg);
    max-width: 600px;
    margin: auto;
  }
  
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

/* Sidebar styles for desktop */
.logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #2a2a2a;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.nav-links li {
  margin-bottom: 4px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #a0a0a0;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
  background: #242424;
  color: #ffffff;
}

.nav-footer {
  padding: 16px 24px;
  border-top: 1px solid #2a2a2a;
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.status-dot.online {
  background: var(--accent-success);
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

/* Form steps */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.step-header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.step-icon {
  font-size: 32px;
}

.step-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

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

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.required {
  color: var(--accent-danger);
}

/* Score grid */
.score-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .score-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.score-item {
  background: var(--bg-card-alt);
  padding: 12px;
  border-radius: var(--radius-md);
}

.score-item label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.score-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.total-score-display {
  text-align: center;
  padding: 20px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.score-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-primary);
}

.score-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.decision-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Detail modal */
.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-section p {
  color: var(--text-dark);
  line-height: 1.6;
}

/* Progress steps */
.modal-progress {
  padding: 12px 20px;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-color);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.5;
}

.progress-step.active, .progress-step.completed {
  opacity: 1;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.progress-step.active .step-num {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.progress-step.completed .step-num {
  background: var(--accent-success);
  border-color: var(--accent-success);
  color: white;
}

.step-label {
  font-size: 10px;
  color: var(--text-secondary);
}

.footer-left, .footer-right {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-success {
  background: var(--accent-success);
  color: white;
}
