/* app.css — MADignite MVP workplan UI */

.app-wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }

/* Nav */
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-size: 13px; color: var(--fg-muted); text-decoration: none;
  letter-spacing: 0.04em; transition: color 0.15s;
}
.nav-link:hover, .nav-link--active { color: var(--fg); }
.nav-link--active { color: var(--accent); font-weight: 500; }

/* Header */
.app-header { padding: 56px 0 40px; }
.app-header-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.app-kicker {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: #e07b39;
  margin-bottom: 10px;
}
.app-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 800;
  color: var(--fg); margin-bottom: 8px; line-height: 1.1;
}
.app-sub { font-size: 15px; color: var(--fg-muted); }

/* Workstream bar */
.ws-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 16px 0; border-bottom: 1px solid var(--divider);
  margin-bottom: 32px;
}
.ws-tab {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--divider);
  color: var(--fg-muted); padding: 8px 16px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.ws-tab:hover { border-color: var(--accent); color: var(--fg); }
.ws-tab--active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Empty state */
.empty-state {
  text-align: center; padding: 80px 24px;
}
.empty-icon { font-size: 48px; color: var(--accent); margin-bottom: 20px; }
.empty-state h2 {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--fg); margin-bottom: 12px;
}
.empty-state p { font-size: 15px; color: var(--fg-muted); margin-bottom: 28px; }

/* Buttons */
.btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: 7px; border: none; cursor: pointer;
  transition: all 0.15s; display: inline-block;
}
.btn--primary {
  background: var(--accent); color: #0f0f0e;
}
.btn--primary:hover { background: #ffb620; }
.btn--accent {
  background: var(--accent); color: #0f0f0e; font-weight: 600;
}
.btn--accent:hover { background: #ffb620; }
.btn--secondary {
  background: var(--surface); border: 1px solid var(--divider); color: var(--fg);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost {
  background: transparent; border: 1px solid var(--divider); color: var(--fg-muted);
}
.btn--ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

/* Task cards */
.task-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.task-card {
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 10px; padding: 20px; transition: border-color 0.15s;
}
.task-card--red   { border-left: 3px solid #e04040; }
.task-card--yellow { border-left: 3px solid var(--accent); }
.task-card--green { border-left: 3px solid #40c480; }

.task-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.task-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-priority {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px;
  border-radius: 4px;
}
.task-priority--critical { background: rgba(224,64,64,0.15); color: #e04040; }
.task-priority--high      { background: rgba(240,165,0,0.12); color: var(--accent); }
.task-priority--medium    { background: rgba(245,242,235,0.06); color: var(--fg-muted); }
.task-priority--low       { background: rgba(245,242,235,0.04); color: var(--fg-muted); opacity: 0.6; }

.task-status {
  font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 4px;
}
.task-status--not_started  { background: rgba(245,242,235,0.06); color: var(--fg-muted); }
.task-status--in_progress   { background: rgba(64,196,128,0.12); color: #40c480; }
.task-status--blocked      { background: rgba(224,64,64,0.12); color: #e04040; }
.task-status--at_risk       { background: rgba(240,165,0,0.12); color: var(--accent); }
.task-status--complete     { background: rgba(64,196,128,0.12); color: #40c480; text-decoration: line-through; }

.task-deadline { font-size: 12px; color: var(--fg-muted); }
.task-deadline.soon { color: var(--accent); }
.task-deadline.overdue { color: #e04040; }

.task-delete {
  font-size: 18px; background: none; border: none; color: var(--fg-muted);
  cursor: pointer; padding: 0 4px; line-height: 1; opacity: 0;
  transition: opacity 0.15s;
}
.task-card:hover .task-delete { opacity: 1; }
.task-delete:hover { color: #e04040; }

.task-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--fg); margin-bottom: 6px; line-height: 1.3;
}
.task-desc {
  font-size: 14px; color: var(--fg-muted); margin-bottom: 10px; line-height: 1.5;
}
.task-owner { font-size: 12px; color: var(--fg-muted); margin-bottom: 10px; display: block; }

.task-progress {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 12px; font-size: 12px; color: var(--fg-muted);
}
.task-progress-bar {
  height: 4px; background: var(--accent); border-radius: 2px;
  max-width: 200px; flex: 1;
}

/* AI risk block */
.task-ai {
  margin-top: 12px; padding: 12px 14px; border-radius: 7px;
}
.task-ai--red    { background: rgba(224,64,64,0.1); border: 1px solid rgba(224,64,64,0.25); }
.task-ai--yellow { background: rgba(240,165,0,0.08); border: 1px solid rgba(240,165,0,0.2); }
.task-ai--green  { background: rgba(64,196,128,0.06); border: 1px solid rgba(64,196,128,0.15); }

.task-ai-badge {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 6px;
}
.task-ai--red .task-ai-badge    { color: #e04040; }
.task-ai--yellow .task-ai-badge { color: var(--accent); }
.task-ai--green .task-ai-badge  { color: #40c480; }

.task-ai-text { font-size: 13px; color: var(--fg); line-height: 1.5; }

.task-edit-row { margin-top: 12px; }
.btn-edit {
  font-size: 12px; background: none; border: 1px solid var(--divider);
  color: var(--fg-muted); padding: 5px 12px; border-radius: 5px; cursor: pointer;
  transition: all 0.15s;
}
.btn-edit:hover { border-color: var(--accent); color: var(--accent); }

/* Analyze bar */
.analyze-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--divider);
  border-radius: 10px; margin-bottom: 24px; gap: 16px;
}
.analyze-info { display: flex; flex-direction: column; gap: 4px; }
.analyze-label {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.06em;
}
.analyze-hint { font-size: 13px; color: var(--fg-muted); }

/* Add task form */
.add-task {
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 10px; padding: 24px; display: none;
}
.add-task.open { display: block; }
.add-task-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--fg); margin-bottom: 20px;
}

/* Forms */
.form-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.form-group--wide { flex: 2; }
.form-group label { font-size: 12px; color: var(--fg-muted); font-weight: 500; letter-spacing: 0.03em; }

input, select, textarea {
  background: var(--bg-alt); border: 1px solid var(--divider);
  color: var(--fg); padding: 10px 12px; border-radius: 6px;
  font-family: var(--font-body); font-size: 14px; width: 100%;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
textarea { resize: vertical; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* Task empty */
.task-empty {
  text-align: center; padding: 40px 24px;
  color: var(--fg-muted); font-size: 14px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); z-index: 300; cursor: pointer;
}
.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--bg-alt); border: 1px solid var(--divider);
  border-radius: 14px; padding: 32px; width: 520px; max-width: 95vw;
  z-index: 301; box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--fg); margin-bottom: 24px;
}

/* WS form in modal */
.ws-form .form-group { margin-bottom: 14px; }

@media (max-width: 640px) {
  .app-header-inner { flex-direction: column; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .form-group--wide { flex: 1; }
  .analyze-bar { flex-direction: column; align-items: flex-start; }
}