wireplanner/static/style.css

215 lines
8.6 KiB
CSS

*, *::before, *::after { box-sizing: border-box; }
:root {
--bg: #1a1a2e;
--surface: #16213e;
--surface2: #0f3460;
--text: #e0e0e0;
--text-muted: #999;
--accent: #e94560;
--border: #333;
--green: #4ecca3;
--orange: #f0a500;
--red: #e94560;
--blue: #4a9ff5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
color: var(--text);
background: var(--bg);
font-size: 14px;
line-height: 1.5;
}
body { margin: 0; padding: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 1em 0 0.5em; font-weight: 600; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.1em; }
small, .muted { color: var(--text-muted); font-size: 0.85em; }
.comment { color: var(--text-muted); font-style: italic; }
/* NAV */
.top-nav {
display: flex; align-items: center; gap: 1.5em;
padding: 0.6em 1.5em; background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1.1em; color: var(--accent) !important; }
.nav-links { display: flex; gap: 1em; }
.nav-links a { color: var(--text); }
main { max-width: 1200px; margin: 0 auto; padding: 1em 1.5em; }
/* CARDS & GRID */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8em; }
.card {
display: block; padding: 0.8em; background: var(--surface);
border: 1px solid var(--border); border-radius: 4px;
transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card strong { display: block; }
.card span { display: block; color: var(--text-muted); font-size: 0.9em; }
.alert { padding: 0.6em 1em; border-radius: 4px; margin-bottom: 1em; }
.alert-error { background: #442222; border: 1px solid var(--red); color: #ff8888; }
/* BUTTONS */
.btn, button {
display: inline-block; padding: 0.4em 0.9em; font-size: 0.9em;
background: var(--surface2); color: var(--text);
border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
font-family: inherit;
}
.btn:hover, button:hover { border-color: var(--accent); }
.btn-danger, button.btn-danger { background: #442222; border-color: var(--red); color: #ff8888; }
.btn-danger:hover, button.btn-danger:hover { background: #552222; }
.btn-sm, button.btn-sm { padding: 0.2em 0.5em; font-size: 0.8em; }
/* FORMS */
label { display: block; margin-bottom: 0.3em; font-size: 0.9em; }
input, select, textarea {
display: block; width: 100%; max-width: 400px;
padding: 0.4em 0.6em; margin-bottom: 0.5em;
background: var(--bg); color: var(--text);
border: 1px solid var(--border); border-radius: 4px;
font-family: inherit; font-size: inherit;
}
fieldset { border: 1px solid var(--border); border-radius: 4px; padding: 0.8em; margin-bottom: 0.8em; }
details { margin: 0.8em 0; }
details summary { cursor: pointer; color: var(--blue); margin-bottom: 0.5em; }
.inline-form { margin-top: 0.5em; }
/* TABLE */
table { width: 100%; border-collapse: collapse; margin: 0.8em 0; }
th, td { padding: 0.4em 0.7em; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9em; }
th { background: var(--surface); font-weight: 600; }
/* RACK LAYOUT */
.rack-table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.rack-table th { background: var(--surface); font-weight: 600; padding: 0.3em 0.6em; text-align: center; }
.rack-table td { padding: 0; border-bottom: 1px solid #222; vertical-align: top; }
.rack-table .unit-num { color: var(--text-muted); width: 2.5em; text-align: center; font-size: 0.75em; vertical-align: middle; }
.rack-table .rack-cell { width: 45%; padding: 2px 0.4em; }
.rack-table tr.device-start td { border-top: 2px solid #444; }
.rack-table tr.device-start td.rack-cell { background: var(--surface); }
.rack-device { display: flex; flex-direction: column; padding: 0.15em 0; }
.rack-device strong { font-size: 0.9em; }
.rack-device small { font-size: 0.75em; }
.rack-toolbar { display: flex; gap: 0.5em; align-items: center; margin-bottom: 0.5em; }
/* DEVICE SECTIONS */
.device-section { margin-bottom: 1.5em; padding: 0.8em; background: var(--surface); border-radius: 4px; }
.device-section h4 { margin-top: 0; }
.device-meta p { margin: 0.3em 0; }
/* PORTS */
.ports { display: flex; gap: 1.5em; }
.port-column { flex: 1; }
.port-column h5 { margin: 0 0 0.3em; }
.port {
display: inline-block; padding: 0.15em 0.5em; margin: 2px;
border: 1px solid var(--border); border-radius: 3px;
font-size: 0.8em; font-family: monospace;
background: var(--bg); cursor: pointer;
transition: border-color 0.15s, background 0.15s;
}
.port:hover { border-color: var(--accent); }
.port.connected { border-width: 2px; }
/* MODAL */
.modal-overlay {
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.7);
z-index: 1000;
display: none;
}
.modal-overlay.open {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background: var(--surface); border: 1px solid var(--border);
border-radius: 6px; padding: 1.5em;
max-width: 650px; width: 95%; max-height: 85vh; overflow-y: auto;
}
.modal-inner { position: relative; }
.modal-close {
position: absolute; top: 0; right: 0;
background: none; border: none; color: var(--text);
font-size: 1.4em; cursor: pointer; padding: 0 0.3em;
}
/* CONNECTION TRACE */
.connection-trace { margin: 1em 0; padding: 0.8em; background: var(--bg); border-radius: 4px; }
.trace-chain { display: flex; align-items: center; gap: 0.3em; flex-wrap: wrap; }
.trace-segment {
padding: 0.3em 0.6em; background: var(--surface); border-radius: 3px;
border: 1px solid var(--border);
}
.trace-segment small { display: block; }
.trace-arrow { color: var(--text-muted); font-weight: bold; }
.trace-clicked {
padding: 0.3em 0.6em; background: var(--surface2); border-radius: 3px;
border: 2px solid var(--accent); display: inline-block;
}
.clicked-badge {
display: block; font-size: 0.65em; color: var(--accent);
text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.2em;
}
.port-ref { font-family: monospace; color: var(--green); font-size: 0.85em; }
.connection-details { margin: 0.8em 0; }
/* POWER STRIP OUTLETS */
.power-strip-outlets { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.3em; margin-top: 0.3em; }
.outlet {
display: flex; flex-direction: column; align-items: center; gap: 0.15em;
padding: 0.3em; border: 1px solid var(--border); border-radius: 4px;
background: var(--bg); cursor: pointer; font-size: 0.8em;
transition: border-color 0.15s, background 0.15s;
}
.outlet:hover { border-color: var(--accent); }
.outlet-used { border-width: 2px; }
.outlet-icon { font-size: 1.2em; }
.outlet-label { font-family: monospace; font-size: 0.8em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* CONNECT MODE */
body.connect-mode .port, body.connect-mode .outlet { cursor: crosshair; }
body.connect-mode .port:hover, body.connect-mode .outlet:hover { border-color: var(--accent); box-shadow: 0 0 4px var(--accent); }
.port-selected, body.connect-mode .port-selected { border-color: var(--accent) !important; background: var(--surface2) !important; box-shadow: 0 0 8px var(--accent); }
.btn-connect-mode.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.connect-status { margin-left: 0.5em; color: var(--accent); font-size: 0.85em; font-style: italic; }
/* PORT EDITOR */
.port-entry { display: flex; gap: 0.5em; align-items: center; margin-bottom: 0.3em; }
.port-entry input { width: 18em; margin-bottom: 0; }
.port-entry select { width: 6em; margin-bottom: 0; }
/* DEVICE TOOLBAR */
.device-toolbar { display: flex; gap: 0.5em; align-items: center; margin-bottom: 0.5em; }
/* DEVICE IMAGES */
.device-images { display: flex; gap: 1.5em; margin: 0.8em 0; }
.device-images img.device-img { max-width: 300px; max-height: 250px; border: 1px solid var(--border); border-radius: 4px; display: block; margin-top: 0.3em; }
/* BADGES */
.badge { display: inline-block; padding: 0.1em 0.4em; font-size: 0.75em; border-radius: 3px; background: var(--surface2); }
.badge-network { background: #224444; color: var(--green); }
.badge-server { background: #332244; color: #b388ff; }
/* SECTION */
section { margin-bottom: 2em; }
/* TOOLBAR */
.toolbar { margin-bottom: 1em; }
/* EMPTY STATE */
.empty-state { padding: 2em 1em; text-align: center; color: var(--text-muted); font-style: italic; border: 1px dashed var(--border); border-radius: 4px; grid-column: 1 / -1; }