add intelligence features; implement signals and predictions pages in admin panel

This commit is contained in:
ImBenji
2026-04-23 22:58:19 +01:00
parent 4ffd31c2ab
commit bec6763191
26 changed files with 3265 additions and 3128 deletions
+117
View File
@@ -0,0 +1,117 @@
/* design tokens + resets + element defaults shared across every admin page */
:root {
--bg: #020817;
--bg-card: #0f172a;
--bg-subtle: #0b1120;
--border: #1e293b;
--border-light: #162032;
--foreground: #f8fafc;
--muted: #94a3b8;
--muted-dark: #475569;
--primary: #f8fafc;
--primary-bg: #1e293b;
--accent: #3b82f6;
--accent-hover: #2563eb;
--destructive: #7f1d1d;
--destructive-fg: #fca5a5;
--radius: 6px;
--radius-lg: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
background: var(--bg);
color: var(--foreground);
font-size: 14px;
min-height: 100vh;
}
/* ── inputs / selects ── */
input[type="text"], input[type="date"], select {
background: var(--bg-subtle);
border: 1px solid var(--border);
color: var(--foreground);
padding: 7px 10px;
border-radius: var(--radius);
font-size: 13px;
outline: none;
min-width: 140px;
transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="date"]:focus, select:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
select option { background: #0f172a; }
/* ── buttons ── */
button {
background: var(--primary-bg);
border: 1px solid var(--border);
color: var(--foreground);
padding: 7px 14px;
border-radius: var(--radius);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background .15s, opacity .1s;
line-height: 1;
}
button:hover { background: #263347; }
button.primary {
background: var(--foreground);
color: #0f172a;
border-color: transparent;
font-weight: 600;
}
button.primary:hover { background: #e2e8f0; }
button.danger {
background: transparent;
border-color: var(--destructive);
color: var(--destructive-fg);
}
button.danger:hover { background: rgba(127, 29, 29, .3); }
button:disabled { opacity: .4; cursor: not-allowed; }
/* textarea — shared across article modal and sql console */
textarea {
background: var(--bg-subtle);
border: 1px solid var(--border);
color: var(--foreground);
padding: 8px 10px;
border-radius: var(--radius);
font-size: 13px;
resize: vertical;
font-family: inherit;
outline: none;
min-height: 120px;
transition: border-color .15s, box-shadow .15s;
}
textarea:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.url-link { color: #60a5fa; text-decoration: none; }
.url-link:hover { text-decoration: underline; }
a { color: inherit; }
+168
View File
@@ -0,0 +1,168 @@
/* reusable building blocks: tables, badges, pagination, dialogs, toasts */
/* ── table ── */
.table-wrap {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
text-align: left;
padding: 10px 14px;
border-bottom: 1px solid var(--border);
color: var(--muted-dark);
font-size: 11px;
text-transform: uppercase;
letter-spacing: .06em;
font-weight: 600;
background: var(--bg-subtle);
}
td {
padding: 10px 14px;
border-bottom: 1px solid var(--border-light);
vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
/* ── truncate ── */
.truncate {
max-width: 280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
/* ── badges ── */
.badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
letter-spacing: .03em;
}
.badge.ok { background: rgba(20, 83, 45, .5); color: #86efac; border: 1px solid rgba(134,239,172,.15); }
.badge.err { background: rgba(127, 29, 29, .5); color: #fca5a5; border: 1px solid rgba(252,165,165,.15); }
.badge.pending { background: rgba(30, 58, 95, .5); color: #93c5fd; border: 1px solid rgba(147,197,253,.15); }
.badge.null { background: rgba(30, 41, 59, .7); color: #64748b; border: 1px solid var(--border); }
/* ── pagination ── */
.pagination {
display: flex;
align-items: center;
gap: 10px;
margin-top: 14px;
color: var(--muted-dark);
font-size: 12px;
font-weight: 500;
}
.pagination button { font-size: 12px; padding: 5px 12px; }
/* ── overlay / dialog ── */
.overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(2, 8, 23, .75);
backdrop-filter: blur(4px);
z-index: 100;
align-items: center;
justify-content: center;
}
.overlay.open { display: flex; }
.modal {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 28px;
width: 680px;
max-width: 95vw;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
}
.modal h2 {
font-size: 16px;
font-weight: 600;
margin-bottom: 6px;
letter-spacing: -.01em;
}
.modal-divider {
height: 1px;
background: var(--border);
margin: 16px -28px;
}
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.field label {
font-size: 11px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: .05em;
}
.field input[type="text"],
.field textarea,
.field select { width: 100%; min-width: unset; }
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid var(--border);
}
/* ── toast ── */
#toast {
position: fixed;
bottom: 24px;
right: 24px;
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--foreground);
padding: 10px 16px;
border-radius: var(--radius);
font-size: 13px;
font-weight: 500;
display: none;
z-index: 200;
box-shadow: 0 8px 24px rgba(0,0,0,.4);
gap: 8px;
align-items: center;
}
#toast.show { display: flex; }
#toast .toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
#toast.error .toast-dot { background: #ef4444; }
+534
View File
@@ -0,0 +1,534 @@
/* intelligence-specific styling: stat cards, detail body, graph, signals */
/* ── intel stats ── */
.intel-stat-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 14px 18px;
display: flex;
flex-direction: column;
gap: 4px;
min-width: 130px;
}
.intel-stat-card .label {
font-size: 11px;
color: var(--muted-dark);
font-weight: 500;
text-transform: uppercase;
letter-spacing: .06em;
}
.intel-stat-card .value {
font-size: 20px;
font-weight: 700;
color: var(--foreground);
letter-spacing: -.02em;
line-height: 1;
}
/* ── intel detail body (modal) ── */
.intel-body {
font-size: 13px;
line-height: 1.7;
white-space: pre-wrap;
word-break: break-word;
background: var(--bg-subtle);
padding: 14px;
border-radius: var(--radius);
border: 1px solid var(--border);
font-family: "SF Mono", "Fira Code", monospace;
}
/* ── graph view ── */
#intel-graph-layout {
display: flex;
gap: 14px;
}
#intel-graph-svg-wrap {
flex: 1;
position: relative;
background: var(--bg-subtle);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
height: 600px;
}
#intel-graph-svg {
width: 100%;
height: 100%;
display: block;
cursor: grab;
}
#intel-graph-svg:active { cursor: grabbing; }
#graph-controls {
position: absolute;
top: 10px;
left: 10px;
display: flex;
gap: 8px;
flex-wrap: wrap;
align-items: center;
z-index: 10;
}
#graph-search {
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--foreground);
padding: 5px 9px;
border-radius: var(--radius);
font-size: 12px;
min-width: 170px;
outline: none;
font-family: inherit;
}
#graph-search:focus { border-color: var(--accent); }
#graph-search::placeholder { color: var(--muted-dark); }
#graph-chips {
display: flex;
gap: 4px;
}
.graph-chip {
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--muted);
padding: 4px 10px;
border-radius: var(--radius);
font-size: 11px;
cursor: pointer;
font-family: inherit;
transition: color 120ms, background 120ms, border-color 120ms;
}
.graph-chip:hover { color: var(--foreground); }
.graph-chip.active {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
#graph-legend {
position: absolute;
bottom: 10px;
left: 10px;
display: flex;
gap: 14px;
font-size: 11px;
color: var(--muted);
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 6px 10px;
z-index: 10;
}
.graph-legend-dot {
display: inline-block;
width: 12px;
height: 3px;
border-radius: 2px;
margin-right: 5px;
vertical-align: middle;
}
#graph-info {
width: 270px;
flex-shrink: 0;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 16px;
overflow-y: auto;
height: 600px;
}
#graph-info-title {
font-size: 14px;
font-weight: 600;
margin-bottom: 4px;
}
#graph-info-sector {
display: inline-block;
padding: 2px 8px;
border-radius: 11px;
font-size: 11px;
background: var(--border);
color: var(--foreground);
margin-bottom: 12px;
}
.graph-group-title {
margin-top: 14px;
font-size: 10.5px;
text-transform: uppercase;
letter-spacing: 0.6px;
color: var(--muted);
padding-bottom: 3px;
border-bottom: 1px solid var(--border);
}
.graph-conn-row {
font-size: 12px;
border-bottom: 1px solid var(--border-light);
}
.graph-conn-row:last-child {
border-bottom: none;
}
.graph-conn-head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
padding: 6px 0;
cursor: pointer;
user-select: none;
}
.graph-conn-head:hover .graph-conn-label { color: var(--accent); }
.graph-conn-right {
display: flex;
align-items: center;
gap: 8px;
}
.graph-conn-toggle {
color: var(--muted-dark);
font-size: 10px;
width: 10px;
display: inline-block;
}
.graph-conn-row.expanded .graph-conn-toggle { color: var(--accent); }
.graph-conn-sector {
color: var(--muted-dark);
font-size: 11px;
}
.graph-conn-body {
display: none;
padding: 4px 0 10px 10px;
border-left: 2px solid var(--border);
margin-left: 2px;
}
.graph-conn-row.expanded .graph-conn-body {
display: block;
}
.graph-evidence-loading,
.graph-evidence-error,
.graph-evidence-empty {
color: var(--muted-dark);
font-size: 11px;
padding: 4px 0;
}
.graph-evidence-error { color: var(--destructive-fg); }
.graph-evidence-stats {
display: flex;
align-items: center;
gap: 8px;
font-size: 11px;
color: var(--muted);
padding: 2px 0 6px;
}
.graph-evidence-badge {
display: inline-block;
padding: 1px 7px;
border-radius: 10px;
background: var(--border);
color: var(--foreground);
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.4px;
}
.graph-evidence-section {
margin-top: 8px;
margin-bottom: 4px;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--muted-dark);
}
.graph-evidence-fact {
padding: 5px 0;
border-bottom: 1px dashed var(--border-light);
}
.graph-evidence-fact:last-child { border-bottom: none; }
.graph-evidence-claim {
font-size: 11.5px;
color: var(--foreground);
line-height: 1.4;
}
.graph-evidence-meta {
font-size: 10.5px;
color: var(--muted-dark);
margin-top: 2px;
}
.graph-evidence-event {
margin: 4px 0;
font-size: 11px;
}
.graph-evidence-event > summary {
cursor: pointer;
list-style: none;
display: flex;
justify-content: space-between;
gap: 8px;
padding: 4px 0;
color: var(--foreground);
}
.graph-evidence-event > summary::-webkit-details-marker { display: none; }
.graph-evidence-event > summary:hover { color: var(--accent); }
.graph-evidence-event-title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.graph-evidence-event-id {
color: var(--muted-dark);
font-size: 10px;
flex-shrink: 0;
}
.graph-evidence-articles {
list-style: none;
padding: 4px 0 6px 10px;
margin: 0;
border-left: 1px solid var(--border-light);
}
.graph-evidence-articles li {
padding: 4px 0;
}
.graph-evidence-articles a {
color: var(--accent);
text-decoration: none;
font-size: 11px;
line-height: 1.4;
display: block;
}
.graph-evidence-articles a:hover { text-decoration: underline; }
.graph-evidence-article-meta {
color: var(--muted-dark);
font-size: 10px;
margin-top: 1px;
}
.graph-empty-msg {
color: var(--muted-dark);
font-size: 13px;
margin: 0;
}
.graph-node-label {
font-size: 11px;
fill: var(--foreground);
pointer-events: none;
user-select: none;
font-family: inherit;
}
.graph-node-label-untracked {
fill: var(--muted-dark);
font-size: 10px;
}
.ig-label-bg {
fill: var(--bg-subtle);
fill-opacity: 0.8;
}
.graph-conn-row.untracked .graph-conn-head {
cursor: default;
}
.graph-conn-row.untracked .graph-conn-head:hover .graph-conn-label {
color: inherit;
}
.graph-conn-row.untracked .graph-conn-label {
color: var(--muted);
}
.graph-conn-row.untracked .graph-conn-sector {
font-style: italic;
}
/* ── signal cards ── */
.signal-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 14px;
}
.signal-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
cursor: pointer;
transition: border-color .15s;
}
.signal-card:hover { border-color: var(--muted-dark); }
.signal-card-glance {
padding: 16px;
}
.signal-card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 10px;
gap: 8px;
}
.signal-company {
font-size: 14px;
font-weight: 600;
color: var(--foreground);
line-height: 1.2;
}
.signal-ticker {
font-size: 11px;
color: var(--muted);
margin-top: 2px;
}
.signal-badge {
display: inline-flex;
align-items: center;
padding: 4px 10px;
border-radius: 5px;
font-size: 12px;
font-weight: 700;
letter-spacing: .04em;
flex-shrink: 0;
}
.signal-badge.BUY { background: rgba(20,83,45,.6); color: #4ade80; border: 1px solid rgba(74,222,128,.2); }
.signal-badge.HOLD { background: rgba(92,66,14,.6); color: #fbbf24; border: 1px solid rgba(251,191,36,.2); }
.signal-badge.SELL { background: rgba(127,29,29,.6); color: #f87171; border: 1px solid rgba(248,113,113,.2); }
.signal-tags {
display: flex;
gap: 5px;
flex-wrap: wrap;
margin-bottom: 10px;
}
.signal-tag {
background: var(--bg-subtle);
border: 1px solid var(--border);
color: var(--muted);
padding: 2px 7px;
border-radius: 3px;
font-size: 11px;
font-weight: 500;
}
.signal-summary {
font-size: 12px;
color: var(--muted);
line-height: 1.5;
margin-bottom: 8px;
}
.signal-ts {
font-size: 10.5px;
color: var(--muted-dark);
}
.signal-card-detail {
display: none;
padding: 0 16px 16px;
border-top: 1px solid var(--border-light);
padding-top: 14px;
}
.signal-card.expanded .signal-card-detail { display: block; }
.signal-detail-section {
margin-bottom: 12px;
}
.signal-detail-label {
font-size: 10.5px;
text-transform: uppercase;
letter-spacing: .06em;
color: var(--muted-dark);
font-weight: 600;
margin-bottom: 5px;
}
.signal-detail-section ul {
padding-left: 16px;
margin: 0;
font-size: 12px;
color: var(--muted);
line-height: 1.7;
}
.signal-detail-section p {
font-size: 12px;
color: var(--muted);
line-height: 1.6;
margin: 0;
}
.signal-regen-btn {
margin-top: 10px;
font-size: 12px;
padding: 5px 12px;
background: transparent;
border-color: var(--border);
color: var(--muted);
}
.signal-regen-btn:hover { color: var(--foreground); background: var(--bg-subtle); }
.signal-empty {
color: var(--muted-dark);
font-size: 13px;
padding: 40px 0;
text-align: center;
}
/* ── intel unavailable notice ── */
.intel-unavailable {
color: var(--muted);
padding: 24px 0;
}
+177
View File
@@ -0,0 +1,177 @@
/* page chrome — header, tabs, subnav, stats bar, content shell */
/* ── header ── */
header.app-header {
background: var(--bg-card);
border-bottom: 1px solid var(--border);
padding: 0 24px;
display: flex;
align-items: center;
gap: 24px;
height: 52px;
}
header.app-header h1 {
font-size: 15px;
font-weight: 600;
color: var(--foreground);
letter-spacing: -.01em;
}
header.app-header h1 span {
color: var(--muted);
font-weight: 400;
}
/* ── primary tabs (underline style) ── */
.tabs {
display: flex;
gap: 0;
margin-left: auto;
height: 100%;
align-items: stretch;
}
.tabs a {
background: none;
border: none;
border-bottom: 2px solid transparent;
color: var(--muted);
padding: 0 14px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: color .15s, border-color .15s;
height: 100%;
display: flex;
align-items: center;
text-decoration: none;
}
.tabs a:hover { color: var(--foreground); }
.tabs a.active {
color: var(--foreground);
border-bottom-color: var(--foreground);
}
/* ── subnav (intelligence sub-sections) ── */
.subnav {
background: var(--bg-card);
border-bottom: 1px solid var(--border);
padding: 0 24px;
display: flex;
align-items: stretch;
gap: 0;
height: 38px;
}
.subnav a {
color: var(--muted-dark);
font-size: 12px;
font-weight: 500;
text-decoration: none;
padding: 0 14px;
display: flex;
align-items: center;
border-bottom: 2px solid transparent;
transition: color .15s, border-color .15s;
text-transform: uppercase;
letter-spacing: .05em;
}
.subnav a:hover { color: var(--foreground); }
.subnav a.active {
color: var(--foreground);
border-bottom-color: var(--accent);
}
/* ── stats bar ── */
.stats-bar {
display: flex;
gap: 0;
background: var(--bg-card);
border-bottom: 1px solid var(--border);
padding: 0 24px;
flex-wrap: wrap;
}
.stat {
display: flex;
flex-direction: column;
gap: 3px;
padding: 14px 28px 14px 0;
margin-right: 28px;
border-right: 1px solid var(--border);
padding-right: 28px;
}
.stat:last-child { border-right: none; }
.stat .label {
color: var(--muted-dark);
font-size: 11px;
text-transform: uppercase;
letter-spacing: .06em;
font-weight: 500;
}
.stat .value {
font-size: 22px;
font-weight: 700;
color: var(--foreground);
letter-spacing: -.02em;
line-height: 1;
}
/* ── content ── */
.content { padding: 24px; }
/* ── filters ── */
.filters {
display: flex;
gap: 10px;
margin-bottom: 18px;
flex-wrap: wrap;
align-items: flex-end;
padding: 14px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
}
.filters label {
display: flex;
flex-direction: column;
gap: 5px;
font-size: 11px;
font-weight: 500;
color: var(--muted);
text-transform: uppercase;
letter-spacing: .05em;
}
/* ── section heading ── */
.section-heading {
font-size: 12px;
color: var(--muted-dark);
font-weight: 600;
text-transform: uppercase;
letter-spacing: .06em;
margin-bottom: 12px;
}