/* Sweep custom styles — layered on Pico CSS dark theme */

:root {
  --sweep-bg: #1a1a2e;
  --sweep-card: #16213e;
  --sweep-accent: #0f3460;
  --sweep-highlight: #e94560;
  --sweep-success: #4ecca3;
  --sweep-warning: #f0a500;
  --sweep-info: #7ec8e3;
  --sweep-muted: #6c757d;
}

/* Force dark */
[data-theme="dark"] {
  --pico-background-color: var(--sweep-bg);
  --pico-card-background-color: var(--sweep-card);
}

/* Nav */
nav.sweep-nav {
  background: var(--sweep-card);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--sweep-accent);
  display: flex;
  align-items: center;
  gap: 2rem;
}
nav.sweep-nav .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sweep-highlight);
  text-decoration: none;
}
nav.sweep-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
}
nav.sweep-nav a:hover,
nav.sweep-nav a.active {
  color: #fff;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--sweep-card);
  border: 1px solid var(--sweep-accent);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}
.stat-card .number {
  font-size: 2rem;
  font-weight: 700;
}
.stat-card .label {
  font-size: 0.85rem;
  color: var(--sweep-muted);
  margin-top: 0.25rem;
}

/* Pipeline bar */
.pipeline-bar {
  display: flex;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--sweep-accent);
}
.pipeline-bar .segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  min-width: 2px;
  transition: width 0.3s;
}
.pipeline-bar .segment.scanned { background: #6c757d; }
.pipeline-bar .segment.evaluated { background: #0d6efd; }
.pipeline-bar .segment.approved { background: #198754; }
.pipeline-bar .segment.implementing { background: #fd7e14; }
.pipeline-bar .segment.completed { background: var(--sweep-success); }
.pipeline-bar .segment.rejected { background: var(--sweep-highlight); }
.pipeline-bar .segment.dismissed { background: #495057; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.critical { background: #dc3545; color: #fff; }
.badge.high { background: #fd7e14; color: #fff; }
.badge.medium { background: #ffc107; color: #000; }
.badge.low { background: #6c757d; color: #fff; }
.badge.info { background: #0dcaf0; color: #000; }
.badge.scanned { background: #6c757d; color: #fff; }
.badge.evaluated { background: #0d6efd; color: #fff; }
.badge.approved { background: #198754; color: #fff; }
.badge.implementing { background: #fd7e14; color: #fff; }
.badge.completed { background: var(--sweep-success); color: #000; }
.badge.rejected { background: var(--sweep-highlight); color: #fff; }
.badge.dismissed { background: #495057; color: #fff; }

/* Code context */
.code-context {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'SFMono-Regular', 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}
.code-context .line {
  white-space: pre;
}
.code-context .line.matched {
  background: rgba(233, 69, 96, 0.2);
  border-left: 3px solid var(--sweep-highlight);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}
.code-context .line-num {
  color: #6e7681;
  user-select: none;
  display: inline-block;
  width: 3rem;
  text-align: right;
  margin-right: 1rem;
}

/* Tables */
table {
  width: 100%;
}
table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--sweep-muted);
}
table td {
  font-size: 0.9rem;
  vertical-align: middle;
}
table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: end;
}
.filter-bar select,
.filter-bar input {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-approve { background: #198754; color: #fff; border: none; cursor: pointer; padding: 0.4rem 1rem; border-radius: 4px; }
.btn-reject { background: var(--sweep-highlight); color: #fff; border: none; cursor: pointer; padding: 0.4rem 1rem; border-radius: 4px; }
.btn-dismiss { background: #6c757d; color: #fff; border: none; cursor: pointer; padding: 0.4rem 1rem; border-radius: 4px; }
.btn-scan { background: #0d6efd; color: #fff; border: none; cursor: pointer; padding: 0.4rem 1rem; border-radius: 4px; }

/* Prompt display */
.prompt-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.85rem;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--sweep-accent);
  color: #fff;
  border: 1px solid #30363d;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Bar chart */
.bar-chart .bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.bar-chart .bar-label {
  width: 150px;
  font-size: 0.85rem;
  text-align: right;
  color: var(--sweep-muted);
}
.bar-chart .bar-fill {
  height: 20px;
  background: #0d6efd;
  border-radius: 3px;
  transition: width 0.3s;
}
.bar-chart .bar-value {
  font-size: 0.85rem;
  color: #ccc;
  min-width: 2rem;
}

/* Section */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--sweep-accent);
}

/* Feedback form */
.feedback-form {
  background: var(--sweep-card);
  border: 1px solid var(--sweep-accent);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

/* Flash */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash.success { background: rgba(78, 204, 163, 0.15); border: 1px solid var(--sweep-success); color: var(--sweep-success); }
.flash.error { background: rgba(233, 69, 96, 0.15); border: 1px solid var(--sweep-highlight); color: var(--sweep-highlight); }

/* Kanban Board */
.kanban-board { display: flex; gap: 0.75rem; overflow-x: auto; min-height: 60vh; padding-bottom: 1rem; }
.kanban-column { flex: 1; min-width: 220px; max-width: 300px; background: var(--sweep-card); border: 1px solid var(--sweep-accent); border-radius: 8px; display: flex; flex-direction: column; }
.kanban-column-header { padding: 0.75rem; border-bottom: 1px solid var(--sweep-accent); font-weight: 600; font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; }
.kanban-column-header .count { background: var(--sweep-accent); padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; }
.kanban-cards { flex: 1; overflow-y: auto; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: 65vh; }
.kanban-card { background: var(--sweep-bg); border: 1px solid var(--sweep-accent); border-radius: 6px; padding: 0.75rem; border-left: 4px solid var(--sweep-muted); }
.kanban-card:hover { border-color: var(--sweep-info); }
.kanban-card.priority-critical { border-left-color: #dc3545; }
.kanban-card.priority-high { border-left-color: #fd7e14; }
.kanban-card.priority-medium { border-left-color: #ffc107; }
.kanban-card.priority-low { border-left-color: #6c757d; }
.kanban-card .card-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.kanban-card .card-title a { color: inherit; text-decoration: none; }
.kanban-card .card-title a:hover { color: var(--sweep-info); }
.kanban-card .card-meta { font-size: 0.7rem; color: var(--sweep-muted); margin-bottom: 0.35rem; }
.kanban-card .card-badges { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.kanban-card .card-actions { display: flex; gap: 0.25rem; margin-top: 0.35rem; }
.kanban-card .card-actions button { padding: 0.15rem 0.5rem; font-size: 0.7rem; border-radius: 3px; border: 1px solid var(--sweep-accent); background: transparent; color: #ccc; cursor: pointer; }
.kanban-card .card-actions button:hover { background: var(--sweep-accent); }
.kanban-card .card-actions .move-btn:hover { background: #198754; color: #fff; }
.kanban-card .card-actions .reject-btn:hover { background: var(--sweep-highlight); color: #fff; }

/* Source badges */
.badge.scanner { background: #6f42c1; color: #fff; }
.badge.manual { background: #20c997; color: #000; }

/* Source tabs */
.source-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.source-tabs a { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.85rem; text-decoration: none; color: #ccc; border: 1px solid var(--sweep-accent); }
.source-tabs a:hover, .source-tabs a.active { background: var(--sweep-accent); color: #fff; }

/* Add task button */
.btn-add-task { background: var(--sweep-success); color: #000; border: none; cursor: pointer; padding: 0.5rem 1.2rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem; }
.btn-add-task:hover { opacity: 0.9; }

/* Utility */
.text-muted { color: var(--sweep-muted); }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
