* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; color: #1a1a2e; background: #f5f6f8; line-height: 1.5; }

/* Nav */
nav { background: #1a1a2e; color: #fff; padding: 0 1.5rem; display: flex; align-items: center; height: 3rem; gap: 1.5rem; }
nav a { color: #8888aa; text-decoration: none; font-size: 0.85rem; padding: 0.8rem 0; border-bottom: 2px solid transparent; }
nav a:hover { color: #ccc; }
nav a.active { color: #fff; border-bottom-color: #5c6bc0; }
nav .brand { font-weight: 700; font-size: 1rem; color: #fff; margin-right: 1rem; letter-spacing: -0.02em; }
nav .spacer { flex: 1; }

/* Layout */
.container { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.4rem; margin-bottom: 1rem; font-weight: 600; }
h2 { font-size: 1.1rem; margin-bottom: 0.75rem; font-weight: 600; color: #333; }
p { margin-bottom: 0.75rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid #e2e4e8; border-radius: 6px; padding: 1rem 1.25rem; }
.stat .value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat .label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }
.stat.highlight .value { color: #5c6bc0; }
.stat.warn .value { color: #e67e22; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e4e8; border-radius: 6px; overflow: hidden; margin-bottom: 1.5rem; }
th { background: #f0f1f5; text-align: left; padding: 0.5rem 0.75rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #555; font-weight: 600; }
td { padding: 0.55rem 0.75rem; border-top: 1px solid #eee; font-size: 0.85rem; vertical-align: top; }
tr:hover td { background: #fafbfc; }
td.mono { font-family: 'SF Mono', 'Menlo', monospace; font-size: 0.8rem; }
td.muted { color: #888; }

/* Badges */
.badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 3px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-needs_review { background: #fff3cd; color: #856404; }
.badge-pending { background: #e2e3e5; color: #555; }
.badge-analyzing { background: #cce5ff; color: #004085; }
.badge-queued { background: #e2e3e5; color: #555; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-auto_approved { background: #d1ecf1; color: #0c5460; }
.badge-rejected { background: #f8d7da; color: #721c24; }

/* Buttons */
.btn { display: inline-block; padding: 0.35rem 0.85rem; border: none; border-radius: 4px; font-size: 0.8rem; cursor: pointer; font-weight: 500; text-decoration: none; line-height: 1.4; }
.btn-primary { background: #5c6bc0; color: #fff; }
.btn-primary:hover { background: #4a59b0; }
.btn-approve { background: #28a745; color: #fff; }
.btn-approve:hover { background: #218838; }
.btn-reject { background: #dc3545; color: #fff; }
.btn-reject:hover { background: #c82333; }
.btn-sm { padding: 0.2rem 0.6rem; font-size: 0.75rem; }
.btn + .btn { margin-left: 0.3rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #444; margin-bottom: 0.25rem; }
input[type="text"], textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; font-family: inherit; }
input[type="text"]:focus, textarea:focus { outline: none; border-color: #5c6bc0; box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.15); }
textarea { resize: vertical; min-height: 4rem; }
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-hint { font-size: 0.75rem; color: #888; margin-top: 0.2rem; }

/* Cards */
.card { background: #fff; border: 1px solid #e2e4e8; border-radius: 6px; padding: 1.25rem; margin-bottom: 1rem; }
.card h2 { margin-bottom: 0.5rem; }

/* Detail panel */
.detail-panel { background: #f8f9fb; border: 1px solid #e2e4e8; border-radius: 4px; padding: 1rem; margin: 0.5rem 0; }
.detail-panel h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; color: #444; }
.finding { padding: 0.4rem 0; border-bottom: 1px solid #eee; font-size: 0.8rem; }
.finding:last-child { border-bottom: none; }
.finding .severity { font-weight: 600; text-transform: uppercase; font-size: 0.7rem; margin-right: 0.5rem; }

/* Finding cards with detail */
.finding-card { padding: 0.6rem 0.75rem; border: 1px solid #eee; border-radius: 4px; margin-bottom: 0.5rem; background: #fafbfc; }
.finding-card:last-child { margin-bottom: 0; }
.finding-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.finding-title { font-weight: 500; }
.finding-detail { font-size: 0.8rem; color: #555; margin: 0.35rem 0 0 0; line-height: 1.4; white-space: pre-wrap; font-family: -apple-system, sans-serif; }
.finding-detail code { font-family: 'SF Mono', 'Menlo', monospace; font-size: 0.75rem; background: #f0f1f5; padding: 0.15rem 0.3rem; border-radius: 3px; }
.accept-form { background: #f8f9fb; border-top: 1px solid #eee; padding-top: 0.5rem; margin-top: 0.25rem; }

/* Risk */
.risk-low { color: #28a745; }
.risk-medium { color: #e67e22; }
.risk-high { color: #dc3545; }
.risk-score { font-weight: 700; font-size: 1rem; }

/* Empty state */
.empty { text-align: center; padding: 3rem; color: #999; }
.empty p { font-size: 0.9rem; }

/* Alerts */
.alert { padding: 0.6rem 1rem; border-radius: 4px; font-size: 0.85rem; margin-bottom: 1rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Sticky info bar */
.sticky-bar { position: sticky; top: 3rem; z-index: 10; background: #fff; border: 1px solid #e2e4e8; border-radius: 6px; padding: 0.5rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.sticky-name { font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.sticky-stat { font-size: 0.8rem; color: #555; padding: 0.1rem 0.5rem; background: #f0f1f5; border-radius: 3px; white-space: nowrap; }

/* Section labels */
.section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #888; margin-bottom: 0.5rem; font-weight: 600; }

/* Utility */
.text-muted { color: #888; }
.text-sm { font-size: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Link bar */
.link-bar { display: flex; gap: 0.75rem; margin: 0.5rem 0; }
.link-bar a { font-size: 0.8rem; color: #5c6bc0; text-decoration: none; padding: 0.2rem 0.5rem; border: 1px solid #ddd; border-radius: 3px; background: #fff; }
.link-bar a:hover { background: #f0f1f5; border-color: #5c6bc0; }

/* Chips */
.keyword-list, .maintainer-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.keyword-chip { font-size: 0.75rem; padding: 0.15rem 0.5rem; background: #f0f1f5; border-radius: 3px; color: #555; }
.maintainer-chip { font-size: 0.8rem; padding: 0.15rem 0.5rem; background: #e8eaf6; border-radius: 3px; color: #3949ab; font-weight: 500; }

/* Finding list */
.finding-list { margin: 0.3rem 0 0 1.2rem; font-size: 0.8rem; }
.finding-list li { margin-bottom: 0.25rem; }

/* Dependency tree */
.dep-summary { display: flex; gap: 1rem; padding: 0.5rem 0; font-size: 0.8rem; color: #555; flex-wrap: wrap; }
.dep-summary-item { padding: 0.15rem 0.5rem; background: #f0f1f5; border-radius: 3px; }
.dep-summary-item.warn-text { background: #fff3cd; color: #856404; }
.warn-text { color: #e67e22; }
.dep-tree { margin-top: 0.5rem; }
.tree-node { padding: 0.25rem 0; font-size: 0.85rem; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; gap: 0.4rem; }
.tree-node:last-child { border-bottom: none; }
.tree-connector { color: #ccc; font-family: monospace; font-size: 0.75rem; }
.badge-sm { font-size: 0.65rem; padding: 0.05rem 0.3rem; }
.badge-ghost { background: #e2e3e5; color: #555; font-size: 0.7rem; vertical-align: middle; }

/* Version diff */
.diff-added td { background: #f0fff0; }
.diff-removed td { background: #fff5f5; }
.diff-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }
.diff-add { background: #d4edda; color: #155724; }
.diff-remove { background: #f8d7da; color: #721c24; }
.diff-change { background: #fff3cd; color: #856404; }

/* Bulk action bar */
.bulk-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #fff5f5; border: 1px solid #f5c6cb; border-radius: 4px; margin-bottom: 0.75rem; }

/* Inline confirm */
.confirm-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; background: #f8f9fb; border: 1px solid #e2e4e8; border-radius: 4px; }
.confirm-text { font-size: 0.85rem; font-weight: 600; margin-right: 0.25rem; }

/* Toast notifications */
.toast { position: fixed; top: 3.5rem; right: 1rem; padding: 0.6rem 1.2rem; border-radius: 6px; font-size: 0.85rem; z-index: 1000; opacity: 0; transition: opacity 0.3s; background: #1a1a2e; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast-visible { opacity: 1; }
.toast-success { background: #155724; }
.toast-error { background: #721c24; }

/* HTMX loading */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }
