Files
charging_station/frontend/src/styles.css
T
julian 069d544bb5 feat: private session history, own-permissions view, plug-gated start button
- non-admins now see ONLY their own sessions in /api/sessions (own app
  starts + own linked cards); gun scopes grant control, not visibility;
  admins see everything
- Account page shows the logged-in user's permissions in plain words
  (Administrator badge, or the guns/relays they control), built solely
  from data already visible to them
- Start button arms only when the gun reports Preparing (cable in the
  car); idle unplugged gun shows an explanatory hint instead
- keep owner's app rename to 'Art IoT'
- smoke test: 59 checks (gun-scoped user sees no foreign sessions)
2026-07-12 09:04:06 +02:00

391 lines
14 KiB
CSS

/* ============================================================
Art IoT — instrument-panel design system
Surfaces like enameled switchgear, copper-busbar accent,
indicator lamps as the signature element.
Type: Archivo (UI) + IBM Plex Mono (telemetry & identifiers).
============================================================ */
:root {
--paper: #eef0ef; /* porcelain enamel */
--panel: #f9faf9;
--panel-inset: #f1f3f2;
--ink: #1d2523; /* deep green-black, like cabinet paint */
--ink-dim: #5d6b67;
--line: #d8ddda;
--copper: #b25c28; /* busbar copper — the accent */
--copper-deep: #8f4a20;
--live: #178a5c; /* DC-on green: charging */
--blue: #2160c4; /* plugged-in blue */
--amber: #c07f00;
--red: #bf3527;
--lamp-off: #c4ccc8;
--shadow: 0 1px 2px rgb(29 37 35 / 0.06), 0 4px 16px rgb(29 37 35 / 0.05);
--radius: 10px;
--font-ui: "Archivo", "Segoe UI", system-ui, sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
:root {
--paper: #131816;
--panel: #1b211f;
--panel-inset: #161c1a;
--ink: #e4e9e7;
--ink-dim: #93a09b;
--line: #2c3531;
--copper: #d07a3e;
--copper-deep: #b25c28;
--live: #2fae7c;
--blue: #4f8ee8;
--amber: #d99a1b;
--red: #d8503f;
--lamp-off: #39433f;
--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 18px rgb(0 0 0 / 0.35);
}
}
* { box-sizing: border-box; margin: 0; }
html { color-scheme: light dark; }
body {
background: var(--paper);
color: var(--ink);
font-family: var(--font-ui);
font-size: 15.5px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible {
outline: 2px solid var(--copper);
outline-offset: 2px;
border-radius: 4px;
}
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.strong { font-weight: 600; }
.dim { color: var(--ink-dim); }
.num { text-align: right; }
/* ---------- indicator lamp (signature element) ---------- */
.lamp {
display: inline-block;
width: 11px; height: 11px;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--lamp-off) 60%, white 25%), var(--lamp-off) 70%);
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.35);
vertical-align: baseline;
flex: none;
}
.lamp--green {
background: radial-gradient(circle at 35% 30%, #8fe8c2, var(--live) 70%);
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 8px color-mix(in srgb, var(--live) 55%, transparent);
}
.lamp--amber {
background: radial-gradient(circle at 35% 30%, #ffd98a, var(--amber) 70%);
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 8px color-mix(in srgb, var(--amber) 55%, transparent);
}
.lamp--red {
background: radial-gradient(circle at 35% 30%, #ff9d8f, var(--red) 70%);
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 8px color-mix(in srgb, var(--red) 55%, transparent);
}
.lamp--blue {
background: radial-gradient(circle at 35% 30%, #9ec4ff, var(--blue) 70%);
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 8px color-mix(in srgb, var(--blue) 55%, transparent);
}
.lamp--pulse-blue { animation: lamp-pulse-blue 1.5s ease-in-out infinite; }
@keyframes lamp-pulse-blue {
0%, 100% {
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent);
filter: brightness(0.85);
}
50% {
box-shadow: inset 0 0 2px rgb(0 0 0 / 0.25), 0 0 15px color-mix(in srgb, var(--blue) 90%, transparent);
filter: brightness(1.15);
}
}
@media (prefers-reduced-motion: reduce) {
.lamp--pulse-blue { animation: none; }
* { transition: none !important; }
}
/* ---------- app shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
display: flex; align-items: center; gap: 20px;
padding: 10px clamp(14px, 4vw, 32px);
background: var(--panel);
border-bottom: 1px solid var(--line);
position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 30px; height: 30px; }
.brand__mark path { fill: var(--copper); }
.brand__name { display: block; font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; }
.brand__sub {
display: block; font-family: var(--font-mono); font-size: 10.5px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim);
}
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav__link {
display: inline-flex; align-items: center; gap: 7px;
padding: 7px 13px;
border-radius: 8px;
color: var(--ink-dim);
text-decoration: none;
font-weight: 500;
white-space: nowrap;
}
.nav__link:hover { color: var(--ink); background: var(--panel-inset); }
.nav__link.active { color: var(--copper-deep); background: color-mix(in srgb, var(--copper) 12%, transparent); font-weight: 600; }
.badge {
background: var(--amber); color: #fff;
font-family: var(--font-mono); font-size: 11px; font-weight: 600;
border-radius: 999px; padding: 1px 7px;
}
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__who {
font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim);
text-decoration: none; padding: 4px 8px; border-radius: 6px;
}
.topbar__who:hover { color: var(--ink); background: var(--panel-inset); }
.topbar__who.active { color: var(--copper-deep); }
.alert {
display: flex; align-items: center; gap: 10px;
margin: 14px clamp(14px, 4vw, 32px) 0;
padding: 11px 16px;
border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
background: color-mix(in srgb, var(--amber) 9%, var(--panel));
border-radius: var(--radius);
color: var(--ink);
text-decoration: none;
font-weight: 500;
}
.alert:hover { border-color: var(--amber); }
.content {
width: min(1060px, 100%);
margin: 0 auto;
padding: 22px clamp(14px, 4vw, 32px) 60px;
display: flex; flex-direction: column; gap: 18px;
}
.boot, .empty {
display: flex; align-items: center; justify-content: center; gap: 10px;
padding: 48px 20px; color: var(--ink-dim); text-align: center;
}
/* ---------- login ---------- */
.login {
min-height: 100dvh; display: grid; place-items: center;
padding: 20px;
background:
radial-gradient(800px 400px at 80% -10%, color-mix(in srgb, var(--copper) 9%, transparent), transparent),
var(--paper);
}
.login__panel {
width: min(380px, 100%);
background: var(--panel);
border: 1px solid var(--line);
border-radius: 14px;
box-shadow: var(--shadow);
padding: 30px 28px;
display: flex; flex-direction: column; gap: 14px;
}
.login__head { text-align: center; margin-bottom: 6px; }
.login__mark { width: 44px; height: 44px; margin-bottom: 10px; }
.login__mark path { fill: var(--copper); }
.login__head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.login__head p { color: var(--ink-dim); font-size: 13.5px; margin-top: 4px; }
/* ---------- panels & bays ---------- */
.panel {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 18px 20px;
}
.panel--attention { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); }
.panel--offline { display: flex; gap: 14px; align-items: center; }
.panel--offline p { color: var(--ink-dim); font-size: 14px; }
.panel__head {
display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
margin-bottom: 12px; flex-wrap: wrap;
}
.panel__head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.panel__meta { color: var(--ink-dim); font-size: 13px; }
.panel__inset {
margin-top: 14px; padding: 16px;
background: var(--panel-inset);
border: 1px solid var(--line);
border-radius: 8px;
}
.panel__inset h3 { font-size: 14px; margin-bottom: 10px; }
.bays {
display: grid; gap: 18px;
grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.bay {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 18px 20px;
display: flex; flex-direction: column; gap: 10px;
border-top: 3px solid var(--copper);
}
.bay__head { display: flex; justify-content: space-between; align-items: center; }
.bay__eyebrow {
font-family: var(--font-mono); font-size: 11px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim);
}
.bay__title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.bay__status { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.bay__hint { color: var(--ink-dim); font-size: 13px; }
.bay__telemetry {
display: flex; gap: 22px;
padding: 10px 12px;
background: var(--panel-inset);
border-radius: 8px;
}
.bay__telemetry dt {
font-family: var(--font-mono); font-size: 10.5px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
}
.bay__telemetry dd { font-weight: 600; font-size: 14px; }
.bay__actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
/* ---------- chips ---------- */
.chip {
display: inline-block;
font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
text-transform: uppercase; letter-spacing: 0.07em;
padding: 3px 9px; border-radius: 999px;
background: var(--panel-inset); color: var(--ink-dim);
border: 1px solid var(--line);
}
.chip--live, .chip--charging { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent); }
.chip--plugged { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.chip--idle { /* the quiet gray default */ }
.chip--offline { opacity: 0.7; }
.chip--faulted, .chip--unavailable { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.chip--card { background: color-mix(in srgb, var(--copper) 13%, transparent); color: var(--copper-deep); border-color: color-mix(in srgb, var(--copper) 40%, transparent); }
.chip--app { background: color-mix(in srgb, var(--live) 12%, transparent); color: var(--live); border-color: color-mix(in srgb, var(--live) 35%, transparent); }
/* ---------- buttons ---------- */
.btn {
border: 1px solid transparent;
border-radius: 8px;
padding: 9px 18px;
font-weight: 600;
cursor: pointer;
background: var(--panel-inset);
transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { background: var(--copper); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--copper-deep); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 85%, black); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--panel-inset); }
.btn--sm { padding: 5px 12px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn--dangertext { color: var(--red); }
/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .field__label {
font-family: var(--font-mono); font-size: 11px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
}
.field input, .field select {
background: var(--paper);
border: 1px solid var(--line);
border-radius: 8px;
padding: 9px 12px;
width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--copper); outline: none; }
.field-error { color: var(--red); font-size: 13.5px; }
.formrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 9px; padding: 4px 0; cursor: pointer; }
.check input { accent-color: var(--copper); width: 16px; height: 16px; }
.check--strong { font-weight: 600; }
.cardform { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.cardform__actions { display: flex; gap: 10px; }
.gunpicker, .matrix { display: flex; flex-direction: column; gap: 6px; }
.permlist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.permlist li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.matrix__group { margin-top: 8px; }
/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
text-align: left; padding: 8px 10px;
font-family: var(--font-mono); font-size: 10.5px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
border-bottom: 1px solid var(--line);
}
.table th.num { text-align: right; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.relay-list, .pending-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.relay {
display: flex; align-items: center; gap: 12px;
padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.relay:last-child { border-bottom: none; }
.relay__label { font-weight: 600; flex: 1; min-width: 0; }
.relay__state { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-dim); }
.pending { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.pending:last-child { border-bottom: none; }
.pending__row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.pending__meta { display: block; color: var(--ink-dim); font-size: 13px; }
.pending__actions { display: flex; gap: 8px; }
/* ---------- toasts ---------- */
.toasts {
position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
display: flex; flex-direction: column; gap: 8px; z-index: 50;
width: min(480px, calc(100vw - 28px));
}
.toast {
background: var(--ink); color: var(--paper);
border-radius: 9px; padding: 11px 16px;
font-size: 14px; box-shadow: var(--shadow);
}
.toast--error { background: var(--red); color: #fff; }
/* ---------- responsive ---------- */
@media (max-width: 640px) {
.topbar { flex-wrap: wrap; row-gap: 6px; }
.nav { order: 3; width: 100%; }
.bay__telemetry { flex-wrap: wrap; gap: 12px 20px; }
.content { padding-top: 14px; }
}