Files
apcupsd-client/app/static/css/base.css
T

551 lines
15 KiB
CSS

/* ========================================================================
Design Tokens — power operations console
======================================================================== */
:root {
/* Surfaces */
--bg: #0d0f12;
--surface: #15191e;
--surface-2: #1d2329;
--surface-3: #273039;
--border: #303942;
--border-hi: #50606e;
/* Text */
--text: #f2f4ef;
--text-muted: #b6c0b9;
--text-dim: #7f8b88;
/* Brand / accent */
--accent: #f4b860;
--accent-hover: #d9922e;
--accent-dim: #49331a;
/* Semantic */
--success: #38d07a;
--success-bg: #102f21;
--warning: #f4b860;
--warning-bg: #3d2a12;
--danger: #ff5a5f;
--danger-bg: #3e181b;
--info: #4cc9c0;
--info-bg: #102f31;
/* Elevation */
--shadow-sm: 0 1px 2px rgba(0,0,0,.3);
--shadow-md: 0 2px 8px rgba(0,0,0,.35);
--shadow-lg: 0 8px 24px rgba(0,0,0,.45);
/* Radii & spacing */
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 8px;
/* Typography */
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}
/* ========================================================================
Reset & base
======================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
font-family: var(--font);
font-size: 14px;
line-height: 1.5;
background:
linear-gradient(90deg, rgba(244, 184, 96, .045) 1px, transparent 1px) 0 0 / 56px 56px,
linear-gradient(0deg, rgba(76, 201, 192, .035) 1px, transparent 1px) 0 0 / 56px 56px,
linear-gradient(180deg, #101317 0%, var(--bg) 42%);
color: var(--text);
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5rem 0; font-weight: 600; color: var(--text); }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre { font-family: var(--font-mono); }
/* ========================================================================
Header & nav
======================================================================== */
.site-header {
display: flex;
align-items: center;
gap: 24px;
padding: 12px 24px;
background: rgba(21, 25, 30, .94);
border-bottom: 1px solid var(--border);
box-shadow: var(--shadow-sm);
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(12px);
}
.site-header .brand a {
color: var(--text);
display: inline-flex;
align-items: center;
gap: 10px;
}
.site-header .brand a:hover { text-decoration: none; color: var(--text); }
.brand-mark {
display: inline-flex;
align-items: center;
justify-content: center;
width: 38px;
height: 26px;
border: 1px solid rgba(244, 184, 96, .65);
border-radius: var(--radius-sm);
color: var(--accent);
background: rgba(244, 184, 96, .08);
font-family: var(--font-mono);
font-size: 11px;
font-weight: 700;
}
.brand-copy {
display: flex;
flex-direction: column;
line-height: 1.05;
}
.brand-title { font-weight: 700; font-size: 15px; }
.brand-subtitle {
color: var(--text-dim);
font-size: 10px;
text-transform: uppercase;
letter-spacing: .8px;
margin-top: 4px;
}
.main-nav {
display: flex;
gap: 4px;
flex: 1;
flex-wrap: wrap;
}
.main-nav a {
color: var(--text-muted);
padding: 7px 14px;
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 500;
transition: background .15s, color .15s;
}
.main-nav a:hover {
background: var(--surface-2);
color: var(--text);
text-decoration: none;
}
.main-nav a.active {
background: rgba(244, 184, 96, .12);
color: var(--accent);
box-shadow: inset 0 0 0 1px rgba(244, 184, 96, .25);
}
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu .username {
font-size: 13px;
color: var(--text-muted);
padding: 4px 8px;
background: var(--surface-2);
border-radius: var(--radius-sm);
}
.btn-logout {
background: transparent;
color: var(--text-muted);
border: 1px solid var(--border);
padding: 6px 12px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 13px;
transition: background .15s, color .15s, border-color .15s;
}
.btn-logout:hover {
background: var(--danger-bg);
color: var(--danger);
border-color: var(--danger);
}
.site-main { padding: 22px 24px 32px; max-width: 1600px; margin: 0 auto; }
/* ========================================================================
Page scaffolding
======================================================================== */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
gap: 16px;
flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 22px; }
.dashboard-header {
display: flex;
align-items: end;
justify-content: space-between;
gap: 16px;
margin-bottom: 16px;
}
.dashboard-header h1 {
margin: 0;
font-size: 26px;
line-height: 1.15;
}
.eyebrow {
margin: 0 0 4px;
color: var(--accent);
font-size: 11px;
font-weight: 700;
letter-spacing: .8px;
text-transform: uppercase;
}
.dashboard-clock {
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 32px;
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: rgba(21, 25, 30, .86);
color: var(--text-muted);
font-family: var(--font-mono);
font-size: 12px;
}
.pulse-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--text-dim);
box-shadow: 0 0 0 0 rgba(76, 201, 192, .35);
}
.dashboard-clock.live .pulse-dot {
background: var(--success);
animation: statusPulse 1.8s ease-out infinite;
}
@keyframes statusPulse {
0% { box-shadow: 0 0 0 0 rgba(56, 208, 122, .32); }
70% { box-shadow: 0 0 0 8px rgba(56, 208, 122, 0); }
100% { box-shadow: 0 0 0 0 rgba(56, 208, 122, 0); }
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input {
padding: 7px 10px;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text);
border-radius: var(--radius-sm);
font-size: 13px;
}
.filters select:focus, .filters input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}
.muted { color: var(--text-dim); font-size: 13px; }
/* ========================================================================
Tables
======================================================================== */
.data-table {
width: 100%;
border-collapse: collapse;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--shadow-sm);
}
.data-table th, .data-table td {
text-align: left;
padding: 10px 14px;
border-bottom: 1px solid var(--border);
font-size: 13px;
color: var(--text);
}
.data-table th {
background: var(--surface-2);
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
font-size: 11px;
letter-spacing: .5px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
/* Severity pills */
.sev {
display: inline-block;
padding: 2px 10px;
border-radius: 999px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .5px;
}
.sev.CRITICAL { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.sev.WARNING { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.sev.INFO { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }
/* ========================================================================
Settings
======================================================================== */
.settings-section {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 20px 24px;
margin-bottom: 20px;
box-shadow: var(--shadow-sm);
max-width: 860px;
}
.settings-section h2 {
margin-top: 0;
font-size: 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
margin-bottom: 18px;
}
.settings-form { display: flex; flex-direction: column; gap: 18px; }
/* ---- Toggle grid (tabular on/off switches) ---- */
.toggle-grid {
display: grid;
grid-template-columns: 1fr;
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
background: var(--surface-2);
}
.toggle-grid.compact .toggle-row { padding: 10px 14px; }
.toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 16px;
border-bottom: 1px solid var(--border);
transition: background .15s;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row:hover { background: var(--surface-3); }
.toggle-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toggle-title { font-size: 14px; color: var(--text); font-weight: 500; }
.toggle-help { font-size: 12px; color: var(--text-dim); }
/* iOS-style switch */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 22px;
flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
position: absolute;
cursor: pointer;
inset: 0;
background: var(--surface-3);
border: 1px solid var(--border-hi);
border-radius: 22px;
transition: background .2s, border-color .2s;
}
.switch .slider::before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
top: 2px;
background: var(--text-muted);
border-radius: 50%;
transition: transform .2s, background .2s;
}
.switch input:checked + .slider {
background: var(--accent-hover);
border-color: var(--accent-hover);
}
.switch input:checked + .slider::before {
transform: translateX(18px);
background: #fff;
}
.switch input:focus-visible + .slider {
box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}
/* ---- Labeled input rows ---- */
.field-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px 20px;
}
.field-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row.wide { grid-column: 1 / -1; }
.field-label {
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: .5px;
font-weight: 600;
}
.field-input {
padding: 8px 12px;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text);
border-radius: var(--radius-sm);
font-size: 13px;
font-family: inherit;
transition: border-color .15s, box-shadow .15s;
}
.field-input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}
.field-input::placeholder { color: var(--text-dim); }
/* Inline (non-grid) single field row */
.settings-form > .field-row { max-width: 280px; }
.form-bar {
display: flex;
gap: 10px;
padding-top: 12px;
border-top: 1px solid var(--border);
margin-top: 4px;
}
@media (max-width: 640px) {
.field-grid { grid-template-columns: 1fr; }
.toggle-row { padding: 12px 14px; }
}
/* ========================================================================
Buttons (global)
======================================================================== */
.btn-primary {
background: var(--accent-hover);
color: #fff;
border: 0;
padding: 9px 16px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background .15s;
}
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
/* ========================================================================
Fleet overview
======================================================================== */
.fleet-overview { margin-bottom: 20px; }
.fleet-card {
background: linear-gradient(180deg, rgba(29, 35, 41, .94), rgba(21, 25, 30, .94));
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 18px 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 0;
box-shadow: var(--shadow-sm);
}
.fleet-stat {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
padding: 2px 18px;
border-left: 1px solid rgba(80, 96, 110, .42);
}
.fleet-stat:first-child { border-left: 0; padding-left: 0; }
.fleet-stat-label {
color: var(--text-dim);
font-size: 11px;
text-transform: uppercase;
letter-spacing: .5px;
font-weight: 600;
}
.fleet-stat-value {
font-size: 24px;
font-weight: 700;
color: var(--text);
line-height: 1.2;
}
.fleet-stat-value.online { color: var(--success); }
.fleet-stat-value.onbatt { color: var(--warning); }
.fleet-stat-value.offline { color: var(--danger); }
/* ========================================================================
State indicators (shared)
======================================================================== */
.state-dot {
display: inline-block;
width: 10px; height: 10px;
border-radius: 50%;
background: var(--text-dim);
margin-right: 8px;
vertical-align: middle;
box-shadow: 0 0 0 2px rgba(255,255,255,.05);
}
.state-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.5); }
.state-dot.onbatt { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,.5); }
.state-dot.offline { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,.5); }
/* ========================================================================
Empty state
======================================================================== */
.empty-state {
text-align: center;
padding: 3rem 1.5rem;
color: var(--text-muted);
background: var(--surface);
border: 1px dashed var(--border);
border-radius: var(--radius-md);
width: 100%;
}
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }
.empty-state a { color: var(--accent); }
/* ========================================================================
Scrollbars
======================================================================== */
* { scrollbar-width: thin; scrollbar-color: var(--border-hi) var(--bg); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 5px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
/* ========================================================================
Responsive
======================================================================== */
@media (max-width: 768px) {
.site-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.main-nav { width: 100%; }
.site-main { padding: 16px; }
.dashboard-header { align-items: flex-start; flex-direction: column; }
.dashboard-header h1 { font-size: 22px; }
.fleet-card { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 14px 16px; }
.fleet-stat { border-left: 0; padding: 8px 0; }
.fleet-stat-value { font-size: 20px; }
}