Files
intrusion-detection/app/static/style.css
T

500 lines
8.4 KiB
CSS

:root {
--bg: #0f172a;
--surface: #1e293b;
--surface-2: #263449;
--border: #334155;
--text: #e2e8f0;
--muted: #94a3b8;
--accent: #22d3ee;
--ok: #34d399;
--warn: #fbbf24;
--danger: #f87171;
--mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family:
system-ui,
-apple-system,
"Segoe UI",
Roboto,
sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
.topbar {
display: flex;
align-items: center;
gap: 1.5rem;
padding: 0.75rem 1.5rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 10;
}
.brand {
font-weight: 700;
letter-spacing: 0.02em;
white-space: nowrap;
}
.topbar nav {
display: flex;
gap: 0.25rem;
flex-wrap: wrap;
}
.topbar nav a {
color: var(--muted);
text-decoration: none;
padding: 0.4rem 0.75rem;
border-radius: 8px;
font-size: 0.9rem;
}
.topbar nav a:hover {
color: var(--text);
background: var(--surface-2);
}
.topbar nav a.active {
color: var(--accent);
background: var(--surface-2);
}
.container {
max-width: 1100px;
margin: 0 auto;
padding: 1.5rem;
}
h1 {
font-size: 1.4rem;
margin: 0 0 0.25rem;
}
h2 {
font-size: 1.05rem;
margin: 0;
}
.muted {
color: var(--muted);
}
.mono {
font-family: var(--mono);
font-size: 0.85rem;
}
.panel {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1rem 1.25rem;
margin: 1rem 0;
}
.panel-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.75rem;
}
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
margin: 1rem 0;
}
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1rem 1.25rem;
}
.card-label {
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--muted);
}
.card-value {
font-size: 1.5rem;
font-weight: 700;
margin-top: 0.25rem;
}
.card-value.ok {
color: var(--ok);
}
.card-value.warn {
color: var(--warn);
}
.card-value.danger {
color: var(--danger);
}
.card-value.muted {
color: var(--muted);
}
.table {
width: 100%;
border-collapse: collapse;
font-size: 0.88rem;
}
.table th {
text-align: left;
color: var(--muted);
font-weight: 600;
border-bottom: 1px solid var(--border);
padding: 0.5rem 0.6rem;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.table td {
padding: 0.5rem 0.6rem;
border-bottom: 1px solid var(--border);
}
.table tr:last-child td {
border-bottom: none;
}
.table .num {
text-align: right;
font-variant-numeric: tabular-nums;
}
.badge {
display: inline-block;
padding: 0.1rem 0.5rem;
border-radius: 999px;
font-size: 0.72rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.03em;
background: var(--surface-2);
color: var(--muted);
}
.badge.ok,
.badge.done {
background: rgba(52, 211, 153, 0.15);
color: var(--ok);
}
.badge.warn,
.badge.running,
.badge.queued {
background: rgba(251, 191, 36, 0.15);
color: var(--warn);
}
.badge.danger,
.badge.error {
background: rgba(248, 113, 113, 0.15);
color: var(--danger);
}
.btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text);
padding: 0.45rem 0.9rem;
border-radius: 8px;
font-size: 0.88rem;
cursor: pointer;
text-decoration: none;
}
.btn:hover {
border-color: var(--accent);
}
.btn.primary {
background: var(--accent);
border-color: var(--accent);
color: #062a35;
font-weight: 600;
}
.btn.primary:hover {
filter: brightness(1.08);
}
.btn.danger {
border-color: rgba(248, 113, 113, 0.5);
color: var(--danger);
}
.btn.danger:hover {
background: rgba(248, 113, 113, 0.12);
}
.btn.ghost {
background: transparent;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.panel-actions {
display: flex;
align-items: center;
gap: 1rem;
margin-top: 1rem;
flex-wrap: wrap;
}
.form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
}
label {
display: flex;
flex-direction: column;
gap: 0.3rem;
font-size: 0.82rem;
color: var(--muted);
}
label.check {
flex-direction: row;
align-items: center;
gap: 0.5rem;
font-size: 0.88rem;
color: var(--text);
margin-top: 1.4rem;
}
input,
select {
background: var(--bg);
border: 1px solid var(--border);
color: var(--text);
border-radius: 8px;
padding: 0.45rem 0.6rem;
font-size: 0.88rem;
}
input:focus,
select:focus {
outline: none;
border-color: var(--accent);
}
.job-status {
margin-top: 1rem;
font-family: var(--mono);
font-size: 0.85rem;
}
#toasts {
position: fixed;
bottom: 1rem;
right: 1rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
z-index: 100;
}
.toast {
padding: 0.6rem 1rem;
border-radius: 8px;
border: 1px solid var(--border);
background: var(--surface);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
font-size: 0.88rem;
max-width: 360px;
}
.toast-error {
border-color: var(--danger);
color: var(--danger);
}
.toast-ok {
border-color: var(--ok);
color: var(--ok);
}
.toast-warn {
border-color: var(--warn);
color: var(--warn);
}
pre.content {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 1rem;
overflow: auto;
max-height: 480px;
font-family: var(--mono);
font-size: 0.8rem;
white-space: pre-wrap;
}
.list {
display: flex;
flex-direction: column;
gap: 0.25rem;
max-height: 300px;
overflow: auto;
padding: 0.25rem;
}
.list a {
color: var(--accent);
text-decoration: none;
font-family: var(--mono);
font-size: 0.85rem;
padding: 0.2rem 0.4rem;
border-radius: 6px;
}
.list a:hover {
background: var(--surface-2);
}
/* Blocklist display */
.table tbody[id="v4"] td {
padding: 0;
}
.table tbody[id="v4"] td .btn {
border-radius: 0;
border: none;
padding: 0.25rem 0.5rem;
}
/* IPv4 graph page */
.graph-controls {
display: flex;
align-items: center;
gap: 1.25rem;
flex-wrap: wrap;
}
.legend {
display: inline-flex;
align-items: center;
gap: 0.5rem;
font-size: 0.82rem;
color: var(--muted);
}
.sw {
display: inline-block;
width: 0.8rem;
height: 0.8rem;
border-radius: 3px;
border: 1px solid var(--border);
}
.sw.red {
background: #e53935;
}
.sw.green {
background: #43a047;
}
.sw.plain {
background: #fff;
}
.graph-wrap {
position: relative;
width: 100%;
max-width: 920px;
margin: 0 auto;
}
#graph-canvas {
display: block;
width: 100%;
height: auto;
aspect-ratio: 1 / 1;
background: #fff;
border: 1px solid var(--border);
border-radius: 8px;
image-rendering: pixelated;
cursor: crosshair;
}
.graph-overlay {
position: absolute;
inset: 0;
pointer-events: none;
}
.g-line {
position: absolute;
background: rgba(148, 163, 184, 0.55);
}
.g-v {
top: 0;
bottom: 0;
width: 1px;
}
.g-h {
left: 0;
right: 0;
height: 1px;
}
.g-label {
position: absolute;
transform: translate(6px, 4px);
font-size: 0.55rem;
line-height: 1;
color: #475569;
white-space: nowrap;
user-select: none;
text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}
.graph-tooltip {
position: absolute;
z-index: 5;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 8px;
padding: 0.5rem 0.65rem;
pointer-events: none;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
max-width: 260px;
}
.graph-tooltip.hidden {
display: none;
}
.tt-head {
font-weight: 600;
margin-bottom: 0.2rem;
}
.tt-status {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.04em;
font-weight: 600;
}
.tt-status.blocked {
color: #e53935;
}
.tt-status.whitelisted {
color: #43a047;
}
.tt-status.unlisted {
color: var(--muted);
}
.tt-list {
margin-top: 0.35rem;
font-size: 0.72rem;
white-space: pre-line;
color: var(--text);
}