/* PulseHQ Dashboard Styles */
:root {
  --warn: #f59e0b;
  --warn-dim: rgba(245, 158, 11, 0.15);
}

.dash-body {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 60px;
}

/* Header */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  flex: 1;
  background: var(--surface);
  padding: 18px 24px;
  text-align: center;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Main Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.right-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

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

.panel-head h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

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

.btn-primary:hover { background: #4f52d4; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon {
  background: none;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}

.btn-icon:hover { color: #ef4444; }

/* Table */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  color: var(--fg-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-raised); }

.task-title-cell { max-width: 300px; }
.task-title { font-weight: 500; margin-bottom: 3px; }
.muted { color: var(--fg-muted); }

/* Skill chips */
.skill-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--fg-muted);
  letter-spacing: 0.3px;
}

/* Priority badges */
.priority-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.p1 { background: rgba(100,116,139,0.15); color: #94a3b8; }
.p2 { background: rgba(34,197,94,0.12); color: #22c55e; }
.p3 { background: rgba(59,162,255,0.12); color: #3b9eff; }
.p4 { background: var(--warn-dim); color: var(--warn); }
.p5 { background: rgba(239,68,68,0.12); color: #ef4444; }

/* Status badges */
.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: capitalize;
}

.s-unassigned { background: var(--warn-dim); color: var(--warn); }
.s-assigned { background: rgba(99,102,241,0.15); color: var(--accent); }
.s-in_progress { background: rgba(59,162,255,0.12); color: #3b9eff; }
.s-completed { background: rgba(34,197,94,0.12); color: var(--success); }

/* Team Members */
.member-list { padding: 8px 0; }

.member-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.member-card:last-child { border-bottom: none; }
.member-card:hover { background: var(--surface-raised); }

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: white;
}

.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; }
.member-role { font-size: 12px; color: var(--fg-muted); }

.member-workload { text-align: right; flex-shrink: 0; }
.workload-pct { font-size: 13px; font-weight: 700; }
.workload-bar-bg {
  width: 64px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Assignment Log */
.log-list { padding: 4px 0; }

.log-entry {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.log-entry:last-child { border-bottom: none; }

.log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.log-task { font-weight: 600; }
.log-arrow { color: var(--fg-dim); }
.log-member { font-weight: 600; }
.log-trigger { font-size: 10px; margin-left: 4px; }
.log-reasoning { font-size: 12px; line-height: 1.5; margin-bottom: 2px; }
.log-time { font-size: 11px; }

/* Empty State */
.empty-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 20px;
}

.modal-head h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

/* Forms */
.form-group {
  padding: 0 24px;
  margin-bottom: 16px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--fg);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

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

.form-group select option { background: var(--surface); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
}

.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-error { border-color: #ef4444; color: #ef4444; }
.toast-success { border-color: var(--success); color: var(--success); }

/* Responsive */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .right-col { order: -1; }
}

@media (max-width: 640px) {
  .dash-header { padding: 12px 16px; }
  .stats-bar { flex-wrap: wrap; }
  .stat-card { flex-basis: 33.33%; }
  .dash-grid { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
