diff --git a/AGENTS.md b/AGENTS.md
index c44639a..fec322b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -41,6 +41,7 @@ frontend/ Next.js 16. Lee Supabase con la clave anon, bajo RLS.
api/hooks/ los mismos, envueltos en TanStack Query
components/ atoms / organisms / screens
lib/ui.ts TODA conversión de unidades, en un solo sitio
+ styles/colors.css TODOS los colores (tema claro y oscuro), en un solo sitio
lib/pallet.ts geometría del dibujo; el tamaño del palé NO es fijo
lib/supabase.ts los tipos, que son la mitad del contrato
@@ -209,10 +210,18 @@ evolución en vez de borrón y cuenta nueva.
- Python 3.11, type hints en las firmas públicas. TypeScript estricto en el front.
- Unidades SI en el dato, milímetros y grados en la pantalla.
+- **Colores solo como variables, y definidas en un único archivo:** `frontend/styles/colors.css`.
+ Ningún otro archivo (CSS, TS, TSX) lleva `#hex`, `rgb()`, `hsl()` ni un color con nombre;
+ consume `var(--…)`. Un color con transparencia es otra variable de ese archivo, calculada
+ con `color-mix` desde la base. `npm run lint` lo comprueba (`scripts/check-colors.mjs`).
- Nombres de código en inglés; comentarios y documentos en castellano.
- Commits pequeños, con números cuando toquen comportamiento.
- El diseño de referencia es `docs/design/observality-platform-design.html`: un bundle
- autoextraíble con 11 tableros. Se abre en el navegador.
+ autoextraíble con 11 tableros. Se abre en el navegador. Manda en la **estructura y el
+ contenido** de cada pantalla; **no** en el aspecto: la identidad visual es la del logo de
+ STACKSPECT (blanco y negro, esquinas suaves, Plus Jakarta Sans y Geist Mono), con tema
+ claro y oscuro. El color con significado (estados, oracle, sembrado, causas de fallo) se
+ conserva en los dos temas. `npm run lint:contrast` garantiza el contraste AA.
---
diff --git a/frontend/app/favicon.ico b/frontend/app/favicon.ico
index 718d6fe..581adec 100644
Binary files a/frontend/app/favicon.ico and b/frontend/app/favicon.ico differ
diff --git a/frontend/app/globals.css b/frontend/app/globals.css
index 3a3b2d6..7762ed5 100644
--- a/frontend/app/globals.css
+++ b/frontend/app/globals.css
@@ -1,55 +1,23 @@
/*
- * Sistema visual de la plataforma. Los valores salen literales del tablero
- * "Lenguaje visual" de docs/design/, no son aproximaciones.
+ * Estilos globales de la plataforma. Los colores NO se definen aquí: viven todos en
+ * styles/colors.css, y este archivo (como cualquier otro) solo los consume con `var(--…)`.
*
- * Sala de control industrial: fondo oscuro, sin adornos, sin degradados. La interfaz
- * se compromete con un solo tema a propósito —es un panel de planta, no un documento—
- * y por eso pinta todos sus colores explícitamente en vez de heredar ninguno.
+ * Lenguaje visual: limpio y amable. Superficies blancas (o casi negras) con esquinas
+ * suaves, mucho aire, poco borde y ninguna sombra que grite. Texto en una sans redondeada;
+ * magnitudes en una mono suave, con cifras de ancho fijo para que no bailen en vivo.
*/
:root {
- /* Neutros */
- --bg: #0F1214;
- --surface: #161A1E;
- --topbar: #141A1E;
- --border: #232B31;
- --border-soft: #1F272C;
- --border-hard: #3E4B56;
- --row-alt: #171C21;
- --row-hover: #1A2026;
-
- --text: #E6EAED;
- --text-2: #9FAAB2;
- --text-3: #8B979F;
- --text-4: #6E7A82;
- --text-5: #46525A;
-
- /* Azul acero: SOLO selección e interacción. Nunca significa estado. */
- --select: #5B9DD9;
- --link: #6FA8D8;
-
- /* Semántica de color: tres significados y ninguno más. */
- --ok: #2FBF71;
- --warn: #E8A93A;
- --bad: #F2544B;
-
- /* Números que no son de verdad. Molestan a la vista a propósito. */
- --oracle: #E5399B;
- --synthetic: #B77BF3;
-
- /* Una identidad de color por causa de fallo, constante en toda la aplicación.
- Se reconocen de un vistazo al pasar de una pantalla a otra. */
- --f-no_detection: #7A8B99;
- --f-grasp_slip: #C9A227;
- --f-ik_unreachable: #5B9DD9;
- --f-wrong_placement: #8C7AE6;
- --f-collision: #B5485E;
- --f-stack_collapse: #FF7A45;
- --f-timeout: #4A5A66;
- --f-overhang_violation: #00A9A5;
- --f-place_inaccurate: #A0785A;
-
- color-scheme: dark;
+ /* Radios: tres tamaños y nada más. Los controles pequeños, las tarjetas y lo grande. */
+ --radius-1: 8px;
+ --radius-2: 12px;
+ --radius-3: 16px;
+ --radius-pill: 999px;
+
+ /* Espaciado de página: el aire que rodea las pantallas. */
+ --page-gap: 20px;
+ --page-pad: 32px;
+ --topbar-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
@@ -60,45 +28,54 @@ body {
min-height: 100%;
background: var(--bg);
color: var(--text);
- font-family: var(--font-plex-sans), system-ui, sans-serif;
+ font-family: var(--font-sans), system-ui, sans-serif;
font-size: 14px;
- line-height: 1.4;
+ line-height: 1.45;
-webkit-font-smoothing: antialiased;
}
-a { color: var(--link); text-decoration: none; }
-a:hover { color: #9CC6E8; }
+/* Un cambio de tema se nota, pero no deslumbra: los colores se funden. */
+body, header, main, section, table, td, th, select, button, label {
+ transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
+}
+
+a {
+ color: var(--link);
+ text-decoration: underline;
+ text-decoration-color: var(--border-hard);
+ text-underline-offset: 3px;
+}
+a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
-:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }
+:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; border-radius: 4px; }
-/* ── piezas compartidas ─────────────────────────────────────────────────── */
+/* ── piezas heredadas ────────────────────────────────────────────────────
+ Las usan Episode.tsx y Runs.tsx, que esperan a las rutas de detalle. Los componentes
+ nuevos no las necesitan: llevan su propio módulo. */
.card {
background: var(--surface);
border: 1px solid var(--border);
+ border-radius: var(--radius-3);
+ box-shadow: var(--elev-1);
display: flex;
flex-direction: column;
min-width: 0;
}
-/* Etiquetas y cabeceras: condensada, versal, muy espaciada. */
.label {
- font-family: var(--font-plex-condensed), var(--font-plex-sans), sans-serif;
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ font-family: var(--font-sans), system-ui, sans-serif;
+ font-size: 12.5px;
+ font-weight: 500;
color: var(--text-3);
}
-.mono { font-family: var(--font-plex-mono), ui-monospace, monospace; }
+.mono { font-family: var(--font-mono), ui-monospace, monospace; }
-/* Toda magnitud física. Monoespaciada y con cifras de ancho fijo para que al
- refrescarse en vivo las columnas no bailen. */
.num {
- font-family: var(--font-plex-mono), ui-monospace, monospace;
+ font-family: var(--font-mono), ui-monospace, monospace;
font-variant-numeric: tabular-nums;
}
diff --git a/frontend/app/icon.png b/frontend/app/icon.png
new file mode 100644
index 0000000..556da8f
Binary files /dev/null and b/frontend/app/icon.png differ
diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx
index cb51e18..10fb9f2 100644
--- a/frontend/app/layout.tsx
+++ b/frontend/app/layout.tsx
@@ -1,43 +1,51 @@
import type { Metadata } from "next";
-import { IBM_Plex_Mono, IBM_Plex_Sans, IBM_Plex_Sans_Condensed } from "next/font/google";
+import { Geist_Mono, Plus_Jakarta_Sans } from "next/font/google";
+import "@/styles/colors.css";
import "./globals.css";
import { AppHeader } from "@/components/screens/AppHeader";
import { Providers } from "./providers";
-/* Las tres voces del diseño, cada una con su trabajo:
- Sans para el texto de interfaz, Condensed para etiquetas y cabeceras en versal,
- y Mono para TODA magnitud física, commit y semilla. */
-const plexSans = IBM_Plex_Sans({
- variable: "--font-plex-sans",
+/* Dos voces, cada una con su trabajo:
+ Plus Jakarta Sans para el texto de interfaz —redondeada y amable, sin perder seriedad—
+ y Geist Mono para TODA magnitud física, commit y semilla. */
+const sans = Plus_Jakarta_Sans({
+ variable: "--font-sans",
subsets: ["latin"],
- weight: ["400", "500", "600"],
-});
-
-const plexCondensed = IBM_Plex_Sans_Condensed({
- variable: "--font-plex-condensed",
- subsets: ["latin"],
- weight: ["500", "600"],
+ weight: ["400", "500", "600", "700"],
});
-const plexMono = IBM_Plex_Mono({
- variable: "--font-plex-mono",
+const mono = Geist_Mono({
+ variable: "--font-mono",
subsets: ["latin"],
- weight: ["400", "500", "600", "700"],
+ weight: ["400", "500", "600"],
});
export const metadata: Metadata = {
- title: "Observabilidad de paletizado",
+ title: "STACKSPECT · Observabilidad de paletizado",
description:
"Monitorización de ejecuciones del brazo paletizador: centro de gravedad, " +
"estabilidad y curva de mejora entre commits.",
};
+/* Fija el tema ANTES del primer pintado, para que no parpadee: el que eligió el usuario y,
+ si no eligió, el del sistema. Va como script en la cabecera y no como efecto de React,
+ que llegaría tarde. */
+const THEME_SCRIPT = `(function () {
+ var theme;
+ try { theme = localStorage.getItem("theme"); } catch (e) {}
+ if (theme !== "light" && theme !== "dark") {
+ theme = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
+ ? "dark" : "light";
+ }
+ document.documentElement.dataset.theme = theme;
+})();`;
+
export default function RootLayout({ children }: LayoutProps<"/">) {
return (
-
+
+
+
+
diff --git a/frontend/components/Episode.tsx b/frontend/components/Episode.tsx
index 667f1af..a8e4107 100644
--- a/frontend/components/Episode.tsx
+++ b/frontend/components/Episode.tsx
@@ -58,12 +58,12 @@ export function CogTrace({ states, height = 220, cursor }: {
{[hi, 0, lo].map((v) => (
+ fill="var(--text-4)" fontFamily="var(--font-mono), monospace">
{v > 0 ? "+" : ""}{v.toFixed(0)}
))}
mm
+ fill="var(--text-4)" fontFamily="var(--font-mono), monospace">mm
@@ -72,12 +72,12 @@ export function CogTrace({ states, height = 220, cursor }: {
fill={`var(--${stabilityState(v / 1000)})`} />
))}
-
+
paquete 1
+ fill="var(--text-4)" fontFamily="var(--font-mono), monospace">
paquete {states.length}
diff --git a/frontend/components/atoms/Badge/Badge.module.css b/frontend/components/atoms/Badge/Badge.module.css
index 55fd810..2de1c01 100644
--- a/frontend/components/atoms/Badge/Badge.module.css
+++ b/frontend/components/atoms/Badge/Badge.module.css
@@ -2,20 +2,20 @@
display: inline-flex;
align-items: center;
gap: 7px;
- padding: 3px 9px;
+ padding: 4px 12px;
border: 1px solid currentColor;
- font-family: var(--font-plex-condensed), sans-serif;
- font-size: 11px;
+ border-radius: var(--radius-pill);
+ font-family: var(--font-sans), system-ui, sans-serif;
+ font-size: 12px;
font-weight: 600;
- letter-spacing: 0.13em;
- text-transform: uppercase;
white-space: nowrap;
}
.neutral { color: var(--text-3); }
-.ok { color: var(--ok); }
-.bad { color: var(--bad); }
+.ok { color: var(--ok); background: var(--ok-fill); }
+.bad { color: var(--bad); background: var(--bad-fill-soft); }
.oracle { color: var(--oracle); }
.synthetic { color: var(--synthetic); }
-.oracle { background: repeating-linear-gradient(135deg, rgba(229, 57, 155, 0.16) 0 7px, transparent 7px 14px); }
-.synthetic { background: repeating-linear-gradient(135deg, rgba(183, 123, 243, 0.16) 0 7px, transparent 7px 14px); }
+/* Los números que no son de verdad molestan a la vista a propósito. */
+.oracle { background: repeating-linear-gradient(135deg, var(--oracle-stripe) 0 7px, transparent 7px 14px); }
+.synthetic { background: repeating-linear-gradient(135deg, var(--synthetic-stripe) 0 7px, transparent 7px 14px); }
diff --git a/frontend/components/atoms/Button/Button.module.css b/frontend/components/atoms/Button/Button.module.css
index 2044d1a..d7601be 100644
--- a/frontend/components/atoms/Button/Button.module.css
+++ b/frontend/components/atoms/Button/Button.module.css
@@ -1,20 +1,22 @@
.button {
font: inherit;
- font-size: 13px;
+ font-size: 13.5px;
+ font-weight: 500;
cursor: pointer;
background: none;
border: 0;
padding: 0;
}
-.button:disabled { cursor: not-allowed; opacity: 0.5; }
+.button:disabled { cursor: not-allowed; opacity: 0.45; }
-/* El azul acero marca interacción, y esto es interacción. */
-.link { color: var(--select); }
-.link:hover:not(:disabled) { color: var(--link); text-decoration: underline; }
+.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
+.link:hover:not(:disabled) { color: var(--link-hover); }
.outline {
color: var(--text);
- border: 1px solid var(--border-hard);
- padding: 6px 12px;
+ background: var(--surface);
+ border: 1px solid var(--control-border);
+ border-radius: var(--radius-1);
+ padding: 8px 16px;
}
-.outline:hover:not(:disabled) { border-color: var(--select); color: var(--select); }
+.outline:hover:not(:disabled) { background: var(--row-hover); }
diff --git a/frontend/components/atoms/Card/Card.module.css b/frontend/components/atoms/Card/Card.module.css
index f48a4e9..b19ab84 100644
--- a/frontend/components/atoms/Card/Card.module.css
+++ b/frontend/components/atoms/Card/Card.module.css
@@ -1,6 +1,9 @@
.card {
background: var(--surface);
border: 1px solid var(--border);
+ border-radius: var(--radius-3);
+ box-shadow: var(--elev-1);
+ overflow: hidden; /* lo de dentro respeta las esquinas redondeadas */
display: flex;
flex-direction: column;
min-width: 0;
diff --git a/frontend/components/atoms/Checkbox/Checkbox.module.css b/frontend/components/atoms/Checkbox/Checkbox.module.css
index 45c69a6..9054c30 100644
--- a/frontend/components/atoms/Checkbox/Checkbox.module.css
+++ b/frontend/components/atoms/Checkbox/Checkbox.module.css
@@ -9,24 +9,25 @@
.box {
appearance: none;
- width: 16px;
- height: 16px;
+ width: 18px;
+ height: 18px;
margin: 0;
- border: 1px solid var(--border-hard);
- background: transparent;
+ border: 1.5px solid var(--control-border);
+ border-radius: 5px;
+ background: var(--surface);
cursor: inherit;
display: grid;
place-content: center;
}
.box:hover:not(:disabled) { border-color: var(--select); }
-/* El azul acero marca selección: es justo su trabajo aquí. */
+/* La tinta marca la selección: es justo su trabajo aquí. */
.box:checked { background: var(--select); border-color: var(--select); }
.box:checked::after {
content: "";
width: 4px;
- height: 8px;
- border: solid var(--bg);
+ height: 9px;
+ border: solid var(--on-select);
border-width: 0 2px 2px 0;
transform: translateY(-1px) rotate(45deg);
}
diff --git a/frontend/components/atoms/Divider/Divider.module.css b/frontend/components/atoms/Divider/Divider.module.css
index 535babd..e049351 100644
--- a/frontend/components/atoms/Divider/Divider.module.css
+++ b/frontend/components/atoms/Divider/Divider.module.css
@@ -1,3 +1,3 @@
-.divider { background: var(--border-hard); flex-shrink: 0; display: block; }
+.divider { background: var(--border); flex-shrink: 0; display: block; }
.horizontal { height: 1px; width: 100%; }
-.vertical { width: 1px; height: 26px; }
+.vertical { width: 1px; height: 24px; }
diff --git a/frontend/components/atoms/Dot/Dot.module.css b/frontend/components/atoms/Dot/Dot.module.css
index 37d4574..881ee71 100644
--- a/frontend/components/atoms/Dot/Dot.module.css
+++ b/frontend/components/atoms/Dot/Dot.module.css
@@ -5,10 +5,10 @@
display: inline-block;
flex-shrink: 0;
}
-.ok { background: var(--ok); --halo: var(--ok); }
-.warn { background: var(--warn); --halo: var(--warn); }
-.bad { background: var(--bad); --halo: var(--bad); }
-.light { background: var(--text); --halo: var(--text); }
-.muted { background: var(--text-4); --halo: var(--text-4); }
+.ok { background: var(--ok); --halo: var(--ok-halo); }
+.warn { background: var(--warn); --halo: var(--warn-halo); }
+.bad { background: var(--bad); --halo: var(--bad-halo); }
+.light { background: var(--text); --halo: var(--light-halo); }
+.muted { background: var(--text-4); --halo: var(--muted-halo); }
-.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--halo) 25%, transparent); }
+.pulse { box-shadow: 0 0 0 3px var(--halo); }
diff --git a/frontend/components/atoms/Icon/Icon.tsx b/frontend/components/atoms/Icon/Icon.tsx
index ba8eca9..e7b48d4 100644
--- a/frontend/components/atoms/Icon/Icon.tsx
+++ b/frontend/components/atoms/Icon/Icon.tsx
@@ -1,6 +1,6 @@
import type { ReactNode } from "react";
-export type IconName = "check" | "arrowDown" | "crosshair" | "circleDot" | "wave" | "x" | "flag" | "chevronsUpDown";
+export type IconName = "check" | "arrowDown" | "crosshair" | "circleDot" | "wave" | "x" | "flag" | "chevronsUpDown" | "sun" | "moon";
/* Trazos de 16×16. Iconos de línea, sin relleno: ninguno lleva color propio, heredan
`currentColor` del que los use. */
@@ -13,6 +13,8 @@ const PATHS: Record = {
x: ,
flag: ,
chevronsUpDown: ,
+ sun: (<> >),
+ moon: ,
};
/** Decorativo: el significado lo lleva el texto de al lado, no el icono. */
diff --git a/frontend/components/atoms/Logo/Logo.module.css b/frontend/components/atoms/Logo/Logo.module.css
new file mode 100644
index 0000000..5f8028b
--- /dev/null
+++ b/frontend/components/atoms/Logo/Logo.module.css
@@ -0,0 +1,37 @@
+.logo {
+ display: inline-flex;
+ align-items: center;
+ gap: calc(var(--logo-size) * 0.32);
+ flex-shrink: 0;
+}
+
+.mark, .word {
+ display: block;
+ background: var(--logo);
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-position: center;
+ mask-position: center;
+ -webkit-mask-size: contain;
+ mask-size: contain;
+}
+
+/* Las proporciones son las de los PNG de public/brand. */
+.mark {
+ height: var(--logo-size);
+ aspect-ratio: 518 / 511;
+ -webkit-mask-image: url("/brand/mark.png");
+ mask-image: url("/brand/mark.png");
+}
+.word {
+ height: calc(var(--logo-size) * 0.34);
+ aspect-ratio: 784 / 64;
+ -webkit-mask-image: url("/brand/wordmark.png");
+ mask-image: url("/brand/wordmark.png");
+}
+.hidden { display: none; }
+
+/* En pantallas estrechas el logo se queda en la marca. */
+@media (max-width: 720px) {
+ .word { display: none; }
+}
diff --git a/frontend/components/atoms/Logo/Logo.tsx b/frontend/components/atoms/Logo/Logo.tsx
new file mode 100644
index 0000000..c3dc259
--- /dev/null
+++ b/frontend/components/atoms/Logo/Logo.tsx
@@ -0,0 +1,22 @@
+import { cx } from "@/lib/cx";
+import styles from "./Logo.module.css";
+
+type Props = {
+ /** `lockup`: marca + nombre. `mark`: solo el círculo con el brazo. */
+ variant?: "lockup" | "mark";
+ /** Alto de la marca, en px. El nombre se escala con ella. */
+ size?: number;
+};
+
+/** El logo de STACKSPECT. Son imágenes usadas como máscara sobre `--logo`, no como fondo:
+ * así se pintan en el color del tema (blanco sobre negro, negro sobre blanco) sin duplicar
+ * el archivo ni dejar un recuadro de otro color. */
+export function Logo({ variant = "lockup", size = 32 }: Props) {
+ return (
+
+
+
+
+ );
+}
diff --git a/frontend/components/atoms/Logo/index.ts b/frontend/components/atoms/Logo/index.ts
new file mode 100644
index 0000000..cd9b833
--- /dev/null
+++ b/frontend/components/atoms/Logo/index.ts
@@ -0,0 +1 @@
+export { Logo } from "./Logo";
diff --git a/frontend/components/atoms/SceneLabel/SceneLabel.module.css b/frontend/components/atoms/SceneLabel/SceneLabel.module.css
index 61d043d..1ece3a9 100644
--- a/frontend/components/atoms/SceneLabel/SceneLabel.module.css
+++ b/frontend/components/atoms/SceneLabel/SceneLabel.module.css
@@ -1,5 +1,5 @@
.label {
- font-family: var(--font-plex-mono), ui-monospace, monospace;
+ font-family: var(--font-mono), ui-monospace, monospace;
font-size: 12.5px;
font-variant-numeric: tabular-nums;
}
diff --git a/frontend/components/atoms/SceneRect/SceneRect.module.css b/frontend/components/atoms/SceneRect/SceneRect.module.css
index 0171548..fefe164 100644
--- a/frontend/components/atoms/SceneRect/SceneRect.module.css
+++ b/frontend/components/atoms/SceneRect/SceneRect.module.css
@@ -5,7 +5,7 @@
.frame { fill: none; stroke: var(--border-hard); stroke-width: 1.5; }
.deck { fill: var(--border); stroke: var(--border-hard); stroke-width: 1; }
.planned { fill: none; stroke: var(--text-4); stroke-width: 1; stroke-dasharray: 4 4; }
-.placed { fill: rgba(155, 170, 178, 0.10); stroke: var(--text-5); stroke-width: 1; }
-.last { fill: rgba(91, 157, 217, 0.16); stroke: var(--select); stroke-width: 2; }
-.failed { fill: rgba(242, 84, 75, 0.16); stroke: var(--bad); stroke-width: 1; }
+.placed { fill: var(--neutral-fill); stroke: var(--text-5); stroke-width: 1; }
+.last { fill: var(--select-fill); stroke: var(--select); stroke-width: 2; }
+.failed { fill: var(--bad-fill); stroke: var(--bad); stroke-width: 1; }
.support { fill: none; stroke: var(--tone); stroke-width: 1.4; stroke-dasharray: 6 4; }
diff --git a/frontend/components/atoms/SceneRect/SceneRect.tsx b/frontend/components/atoms/SceneRect/SceneRect.tsx
index 1654ea9..4ff99b5 100644
--- a/frontend/components/atoms/SceneRect/SceneRect.tsx
+++ b/frontend/components/atoms/SceneRect/SceneRect.tsx
@@ -13,5 +13,6 @@ type Props = {
/** Un rectángulo del dibujo del palé. Coordenadas ya en píxeles: no sabe de metros. */
export function SceneRect({ variant, tone = "ok", ...box }: Props) {
- return ;
+ const rx = variant === "frame" || variant === "deck" ? 8 : 3;
+ return ;
}
diff --git a/frontend/components/atoms/Select/Select.module.css b/frontend/components/atoms/Select/Select.module.css
index 7e5e560..e481e03 100644
--- a/frontend/components/atoms/Select/Select.module.css
+++ b/frontend/components/atoms/Select/Select.module.css
@@ -6,18 +6,19 @@
font-size: 14px;
color: var(--text);
background: var(--surface);
- border: 1px solid var(--border-hard);
- padding: 9px 34px 9px 12px;
+ border: 1px solid var(--control-border);
+ border-radius: var(--radius-1);
+ padding: 9px 36px 9px 14px;
min-height: 40px;
cursor: pointer;
}
-.select:hover { border-color: var(--select); }
-/* Los los pinta el sistema: se les da fondo propio para que no salgan blancos. */
+.select:hover { background: var(--row-hover); }
+/* Los los pinta el sistema: se les da fondo propio para que no salgan de otro tema. */
.select option { background: var(--surface); color: var(--text); }
.chevron {
position: absolute;
- right: 10px;
+ right: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--text-3);
diff --git a/frontend/components/atoms/Sparkline/Sparkline.tsx b/frontend/components/atoms/Sparkline/Sparkline.tsx
index d4a0898..54f3d61 100644
--- a/frontend/components/atoms/Sparkline/Sparkline.tsx
+++ b/frontend/components/atoms/Sparkline/Sparkline.tsx
@@ -17,7 +17,7 @@ export function Sparkline({ ratios, tone, label, height = 26 }: Props) {
return (
- {bars.map((b, i) => )}
+ {bars.map((b, i) => )}
);
}
diff --git a/frontend/components/atoms/Swatch/Swatch.module.css b/frontend/components/atoms/Swatch/Swatch.module.css
index 7aed125..0cea69b 100644
--- a/frontend/components/atoms/Swatch/Swatch.module.css
+++ b/frontend/components/atoms/Swatch/Swatch.module.css
@@ -1 +1 @@
-.swatch { display: inline-block; flex-shrink: 0; }
+.swatch { display: inline-block; flex-shrink: 0; border-radius: 3px; }
diff --git a/frontend/components/atoms/Table/Table.module.css b/frontend/components/atoms/Table/Table.module.css
index 1084cab..521ddb1 100644
--- a/frontend/components/atoms/Table/Table.module.css
+++ b/frontend/components/atoms/Table/Table.module.css
@@ -8,12 +8,10 @@
.th:last-child, .td:last-child { padding-right: 28px; }
.th {
- height: 44px;
- font-family: var(--font-plex-condensed), var(--font-plex-sans), sans-serif;
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ height: 46px;
+ font-family: var(--font-sans), system-ui, sans-serif;
+ font-size: 12.5px;
+ font-weight: 500;
color: var(--text-3);
position: sticky;
top: 0;
@@ -22,7 +20,7 @@
/* Sombra y no borde: con border-collapse el borde no viaja con la cabecera pegajosa. */
box-shadow: inset 0 -1px 0 var(--border);
}
-.td { height: 46px; border-bottom: 1px solid var(--border-soft); }
+.td { height: 54px; border-bottom: 1px solid var(--border-soft); }
.left { text-align: left; }
.right { text-align: right; }
@@ -34,8 +32,8 @@
/* La barra izquierda va en la primera celda: `box-shadow` en no pinta con
border-collapse. */
-.selected { background: rgba(91, 157, 217, 0.10); }
+.selected { background: var(--select-row); }
.selected > .td:first-child { box-shadow: inset 3px 0 0 var(--select); }
.oracle > .td:first-child { box-shadow: inset 3px 0 0 var(--oracle); }
-.synthetic { background: repeating-linear-gradient(135deg, rgba(183, 123, 243, 0.10) 0 7px, transparent 7px 14px); }
+.synthetic { background: repeating-linear-gradient(135deg, var(--synthetic-stripe-soft) 0 7px, transparent 7px 14px); }
.synthetic > .td:first-child { box-shadow: inset 3px 0 0 var(--synthetic); }
diff --git a/frontend/components/atoms/Text/Text.module.css b/frontend/components/atoms/Text/Text.module.css
index 534a71b..68eb774 100644
--- a/frontend/components/atoms/Text/Text.module.css
+++ b/frontend/components/atoms/Text/Text.module.css
@@ -1,23 +1,22 @@
.text { margin: 0; }
-/* Etiquetas y cabeceras: condensada, versal, muy espaciada. */
+/* Etiquetas y cabeceras: la misma sans, en minúscula normal y algo más gruesa. Antes iban
+ en versal espaciada; se leía «sala de control», no «herramienta amable». */
.label {
- font-family: var(--font-plex-condensed), var(--font-plex-sans), sans-serif;
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ font-family: var(--font-sans), system-ui, sans-serif;
+ font-size: 12.5px;
+ font-weight: 500;
}
.body { font-size: 13px; }
-.caption { font-size: 11.5px; }
+.caption { font-size: 12px; }
/* Toda magnitud física: monoespaciada y de cifras fijas para que no bailen en vivo. */
.num, .mono {
- font-family: var(--font-plex-mono), ui-monospace, monospace;
+ font-family: var(--font-mono), ui-monospace, monospace;
font-variant-numeric: tabular-nums;
}
.num { font-size: 13px; }
-.mono { font-size: 12px; }
+.mono { font-size: 12.5px; }
.default { color: var(--text); }
.muted { color: var(--text-3); }
diff --git a/frontend/components/atoms/Value/Value.module.css b/frontend/components/atoms/Value/Value.module.css
index e2c9af0..f78deab 100644
--- a/frontend/components/atoms/Value/Value.module.css
+++ b/frontend/components/atoms/Value/Value.module.css
@@ -1,13 +1,13 @@
.value { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.num {
- font-family: var(--font-plex-mono), ui-monospace, monospace;
+ font-family: var(--font-mono), ui-monospace, monospace;
font-variant-numeric: tabular-nums;
font-weight: 500;
line-height: 1;
}
.unit {
- font-family: var(--font-plex-mono), ui-monospace, monospace;
+ font-family: var(--font-mono), ui-monospace, monospace;
color: var(--text-3);
white-space: nowrap;
}
diff --git a/frontend/components/atoms/index.ts b/frontend/components/atoms/index.ts
index 244e965..07a6eab 100644
--- a/frontend/components/atoms/index.ts
+++ b/frontend/components/atoms/index.ts
@@ -20,3 +20,4 @@ export type { SelectOption } from "./Select";
export { Swatch } from "./Swatch";
export { Table, Th, Td, Tr } from "./Table";
export { Sparkline } from "./Sparkline";
+export { Logo } from "./Logo";
diff --git a/frontend/components/molecules/Banner/Banner.module.css b/frontend/components/molecules/Banner/Banner.module.css
index 9378947..036548f 100644
--- a/frontend/components/molecules/Banner/Banner.module.css
+++ b/frontend/components/molecules/Banner/Banner.module.css
@@ -4,8 +4,10 @@
align-items: center;
flex-wrap: wrap;
gap: 14px;
- padding: 10px 28px;
- background: rgba(232, 169, 58, 0.10);
- border-bottom: 1px solid var(--warn);
+ margin: 12px var(--page-pad) 0;
+ padding: 12px 20px;
+ background: var(--warn-banner);
+ border: 1px solid var(--warn);
+ border-radius: var(--radius-2);
}
.spacer { flex-grow: 1; }
diff --git a/frontend/components/molecules/EventRow/EventRow.module.css b/frontend/components/molecules/EventRow/EventRow.module.css
index 53f9050..42cd497 100644
--- a/frontend/components/molecules/EventRow/EventRow.module.css
+++ b/frontend/components/molecules/EventRow/EventRow.module.css
@@ -1,7 +1,9 @@
.row {
list-style: none;
- min-height: 38px;
- padding: 0 28px;
+ min-height: 42px;
+ padding: 0 12px;
+ margin: 0 12px;
+ border-radius: var(--radius-1);
font-size: 13px;
display: grid;
grid-template-columns: 72px 20px 110px minmax(90px, auto) minmax(0, 1fr);
diff --git a/frontend/components/molecules/FailureStackBar/FailureStackBar.module.css b/frontend/components/molecules/FailureStackBar/FailureStackBar.module.css
index ae7a330..4f92ea2 100644
--- a/frontend/components/molecules/FailureStackBar/FailureStackBar.module.css
+++ b/frontend/components/molecules/FailureStackBar/FailureStackBar.module.css
@@ -1,5 +1,5 @@
.row { display: flex; align-items: center; gap: 20px; }
.label { width: 80px; flex-shrink: 0; font-size: 14px; }
-.bar { flex: 1; min-width: 0; height: 32px; display: flex; background: var(--row-alt); }
+.bar { flex: 1; min-width: 0; height: 30px; display: flex; gap: 2px; border-radius: var(--radius-1); overflow: hidden; background: var(--row-alt); }
.segment { flex-basis: 0; min-width: 2px; }
.none { align-self: center; padding-left: 14px; }
diff --git a/frontend/components/molecules/KpiCard/KpiCard.module.css b/frontend/components/molecules/KpiCard/KpiCard.module.css
index 76e5da8..919c8f9 100644
--- a/frontend/components/molecules/KpiCard/KpiCard.module.css
+++ b/frontend/components/molecules/KpiCard/KpiCard.module.css
@@ -1,4 +1,2 @@
-.kpi { padding: 16px 20px; gap: 14px; justify-content: space-between; }
-
-/* Con estado, la barra izquierda gruesa: se ve el estado sin leer el número. */
-.accent { border-left-width: 4px; }
+.kpi { padding: 20px 24px; gap: 16px; justify-content: space-between; }
+.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
diff --git a/frontend/components/molecules/KpiCard/KpiCard.tsx b/frontend/components/molecules/KpiCard/KpiCard.tsx
index 9421c9b..1ff8034 100644
--- a/frontend/components/molecules/KpiCard/KpiCard.tsx
+++ b/frontend/components/molecules/KpiCard/KpiCard.tsx
@@ -1,5 +1,4 @@
-import { Card, Text, Value } from "../../atoms";
-import { cx } from "@/lib/cx";
+import { Card, Dot, Text, Value } from "../../atoms";
import styles from "./KpiCard.module.css";
type Props = {
@@ -10,12 +9,15 @@ type Props = {
state?: "ok" | "warn" | "bad";
};
-/** Un indicador para leerse a tres metros: etiqueta, número enorme y unidad al lado.
- * Con `state`, el borde y el número toman el color del estado. */
+/** Un indicador para leerse a tres metros: etiqueta, número enorme y unidad al lado. Con
+ * `state`, el número y un punto junto a la etiqueta toman el color del estado. */
export function KpiCard({ label, value, unit, note, state }: Props) {
return (
-
- {label}
+
+
+ {label}
+ {state && }
+
{note && {note} }
diff --git a/frontend/components/molecules/LegendItem/LegendItem.module.css b/frontend/components/molecules/LegendItem/LegendItem.module.css
index 6a5afc5..ba1f558 100644
--- a/frontend/components/molecules/LegendItem/LegendItem.module.css
+++ b/frontend/components/molecules/LegendItem/LegendItem.module.css
@@ -1,5 +1,5 @@
.item { display: inline-flex; align-items: center; gap: 6px; }
-.swatch { width: 14px; height: 10px; border: 1px solid; display: inline-block; }
+.swatch { width: 14px; height: 10px; border: 1px solid; border-radius: 3px; display: inline-block; }
.planned { border-style: dashed; border-color: var(--text-4); }
-.last { border-color: var(--select); background: rgba(91, 157, 217, 0.18); }
+.last { border-color: var(--select); background: var(--select-fill); }
.support { border-style: dashed; border-color: var(--ok); }
diff --git a/frontend/components/molecules/MetaItem/MetaItem.module.css b/frontend/components/molecules/MetaItem/MetaItem.module.css
index 0c951b2..ff9118f 100644
--- a/frontend/components/molecules/MetaItem/MetaItem.module.css
+++ b/frontend/components/molecules/MetaItem/MetaItem.module.css
@@ -1,2 +1,2 @@
.item { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
-.item > :last-child { font-size: 15px; }
+.item > :last-child { font-size: 14.5px; font-weight: 500; }
diff --git a/frontend/components/molecules/NavTab/NavTab.module.css b/frontend/components/molecules/NavTab/NavTab.module.css
index b3717bb..bb4d4a6 100644
--- a/frontend/components/molecules/NavTab/NavTab.module.css
+++ b/frontend/components/molecules/NavTab/NavTab.module.css
@@ -1,8 +1,11 @@
.tab {
font-size: 14px;
+ font-weight: 500;
color: var(--text-3);
- padding: 15px 4px;
- border-bottom: 2px solid transparent;
+ text-decoration: none;
+ padding: 8px 18px;
+ border-radius: var(--radius-pill);
}
-.tab:hover { color: var(--text); }
-.active { color: var(--text); border-bottom-color: var(--text); }
+.tab:hover { color: var(--text); background: var(--row-hover); }
+/* La pestaña activa, en tinta: negro sobre blanco en el tema claro, y al revés. */
+.active, .active:hover { color: var(--on-select); background: var(--select); }
diff --git a/frontend/components/molecules/Notice/Notice.module.css b/frontend/components/molecules/Notice/Notice.module.css
index 5548f66..6d71dfd 100644
--- a/frontend/components/molecules/Notice/Notice.module.css
+++ b/frontend/components/molecules/Notice/Notice.module.css
@@ -1,3 +1,3 @@
-.notice { padding: 40px; max-width: 620px; }
-.title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
-.body { display: block; font-size: 14px; line-height: 1.6; }
+.notice { padding: 48px var(--page-pad); max-width: 640px; }
+.title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
+.body { display: block; font-size: 14.5px; line-height: 1.65; }
diff --git a/frontend/components/molecules/PanelHeader/PanelHeader.module.css b/frontend/components/molecules/PanelHeader/PanelHeader.module.css
index 1506eeb..7bced49 100644
--- a/frontend/components/molecules/PanelHeader/PanelHeader.module.css
+++ b/frontend/components/molecules/PanelHeader/PanelHeader.module.css
@@ -1,11 +1,12 @@
.header {
- min-height: 44px;
+ min-height: 56px;
flex-shrink: 0;
- padding: 0 28px;
+ padding: 0 24px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
border-bottom: 1px solid var(--border-soft);
}
+.title { font-weight: 600; }
.aside { display: flex; align-items: center; gap: 16px; min-width: 0; }
diff --git a/frontend/components/molecules/PanelHeader/PanelHeader.tsx b/frontend/components/molecules/PanelHeader/PanelHeader.tsx
index 3ae3e3b..18aba08 100644
--- a/frontend/components/molecules/PanelHeader/PanelHeader.tsx
+++ b/frontend/components/molecules/PanelHeader/PanelHeader.tsx
@@ -7,7 +7,7 @@ import styles from "./PanelHeader.module.css";
export function PanelHeader({ title, children }: { title: string; children?: ReactNode }) {
return (
-
{title}
+
{title}
{children &&
{children}
}
);
diff --git a/frontend/components/molecules/StatusIndicator/StatusIndicator.module.css b/frontend/components/molecules/StatusIndicator/StatusIndicator.module.css
index 530faaa..c24455a 100644
--- a/frontend/components/molecules/StatusIndicator/StatusIndicator.module.css
+++ b/frontend/components/molecules/StatusIndicator/StatusIndicator.module.css
@@ -1,2 +1,2 @@
.status { display: inline-flex; align-items: center; gap: 10px; }
-.status > :last-child { font-size: 13px; letter-spacing: 0.16em; }
+.status > :last-child { font-size: 14px; font-weight: 600; }
diff --git a/frontend/components/molecules/StatusIndicator/StatusIndicator.tsx b/frontend/components/molecules/StatusIndicator/StatusIndicator.tsx
index ecd259b..18f6d3d 100644
--- a/frontend/components/molecules/StatusIndicator/StatusIndicator.tsx
+++ b/frontend/components/molecules/StatusIndicator/StatusIndicator.tsx
@@ -8,7 +8,7 @@ export function StatusIndicator({ label, tone, pulse }: {
return (
- {label}
+ {label}
);
}
diff --git a/frontend/components/molecules/ThemeToggle/ThemeToggle.module.css b/frontend/components/molecules/ThemeToggle/ThemeToggle.module.css
new file mode 100644
index 0000000..1deb729
--- /dev/null
+++ b/frontend/components/molecules/ThemeToggle/ThemeToggle.module.css
@@ -0,0 +1,12 @@
+.toggle {
+ width: 40px;
+ height: 40px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: var(--radius-pill);
+ color: var(--text-2);
+ border: 1px solid var(--border);
+ background: var(--surface);
+}
+.toggle:hover { background: var(--row-hover); color: var(--text); }
diff --git a/frontend/components/molecules/ThemeToggle/ThemeToggle.tsx b/frontend/components/molecules/ThemeToggle/ThemeToggle.tsx
new file mode 100644
index 0000000..85feff1
--- /dev/null
+++ b/frontend/components/molecules/ThemeToggle/ThemeToggle.tsx
@@ -0,0 +1,15 @@
+import { Icon } from "../../atoms";
+import styles from "./ThemeToggle.module.css";
+
+/** Cambia entre tema claro y oscuro. Enseña el icono del tema al que llevaría. */
+export function ThemeToggle({ theme, onToggle }: {
+ theme: "light" | "dark"; onToggle: () => void;
+}) {
+ const next = theme === "dark" ? "claro" : "oscuro";
+ return (
+
+
+
+ );
+}
diff --git a/frontend/components/molecules/ThemeToggle/index.ts b/frontend/components/molecules/ThemeToggle/index.ts
new file mode 100644
index 0000000..0909d6d
--- /dev/null
+++ b/frontend/components/molecules/ThemeToggle/index.ts
@@ -0,0 +1 @@
+export { ThemeToggle } from "./ThemeToggle";
diff --git a/frontend/components/molecules/ToggleField/ToggleField.module.css b/frontend/components/molecules/ToggleField/ToggleField.module.css
index fce49de..166e85d 100644
--- a/frontend/components/molecules/ToggleField/ToggleField.module.css
+++ b/frontend/components/molecules/ToggleField/ToggleField.module.css
@@ -1,2 +1,2 @@
-.toggle { display: inline-flex; border: 1px solid var(--border-hard); padding-right: 10px; }
-.oracle { border-color: var(--oracle); background: rgba(229, 57, 155, 0.08); }
+.toggle { display: inline-flex; border: 1px solid var(--control-border); border-radius: var(--radius-1); padding-right: 10px; background: var(--surface); }
+.oracle { border-color: var(--oracle); background: var(--oracle-fill); }
diff --git a/frontend/components/molecules/index.ts b/frontend/components/molecules/index.ts
index 92467c4..04bd3b1 100644
--- a/frontend/components/molecules/index.ts
+++ b/frontend/components/molecules/index.ts
@@ -18,3 +18,4 @@ export { InfoMessage } from "./InfoMessage";
export { ColorLegendItem } from "./ColorLegendItem";
export { ToggleField } from "./ToggleField";
export { NavTab } from "./NavTab";
+export { ThemeToggle } from "./ThemeToggle";
diff --git a/frontend/components/organisms/ComparePanel/ComparePanel.helper.ts b/frontend/components/organisms/ComparePanel/ComparePanel.helper.ts
index a12a6cd..a68714b 100644
--- a/frontend/components/organisms/ComparePanel/ComparePanel.helper.ts
+++ b/frontend/components/organisms/ComparePanel/ComparePanel.helper.ts
@@ -81,9 +81,11 @@ function barOf(run: Run, rows: FailureBreakdownRow[] | undefined): BarView {
/** `comparability()` devuelve la tarea como identificador; en pantalla va en castellano. */
function translate(b: Blocker): Blocker {
+ // El campo llega en versal («TAREA»): en pantalla va en minúscula normal, como el resto.
+ const field = b.field.charAt(0) + b.field.slice(1).toLowerCase();
return b.field === "TAREA"
- ? { ...b, a: TASK_TEXT[b.a] ?? b.a, b: TASK_TEXT[b.b] ?? b.b }
- : b;
+ ? { ...b, field, a: TASK_TEXT[b.a] ?? b.a, b: TASK_TEXT[b.b] ?? b.b }
+ : { ...b, field };
}
export function buildComparison(pair: ComparePair | null): ComparisonView {
diff --git a/frontend/components/organisms/EventFeed/EventFeed.module.css b/frontend/components/organisms/EventFeed/EventFeed.module.css
index c1aaa96..b09ff33 100644
--- a/frontend/components/organisms/EventFeed/EventFeed.module.css
+++ b/frontend/components/organisms/EventFeed/EventFeed.module.css
@@ -1,3 +1,3 @@
.feed { flex: 1; min-height: 200px; }
.list { list-style: none; overflow-y: auto; min-height: 0; }
-.empty { padding: 24px 28px; color: var(--text-5); font-size: 13px; }
+.empty { padding: 24px 28px; color: var(--text-4); font-size: 13px; }
diff --git a/frontend/components/organisms/IdentityBar/IdentityBar.module.css b/frontend/components/organisms/IdentityBar/IdentityBar.module.css
index 5484df2..9e0bf15 100644
--- a/frontend/components/organisms/IdentityBar/IdentityBar.module.css
+++ b/frontend/components/organisms/IdentityBar/IdentityBar.module.css
@@ -1,12 +1,14 @@
.bar {
- min-height: 64px;
flex-shrink: 0;
display: flex;
align-items: center;
flex-wrap: wrap;
- gap: 12px 26px;
- padding: 10px 28px;
- background: var(--topbar);
- border-bottom: 1px solid var(--border);
+ gap: 12px 28px;
+ margin: var(--page-gap) var(--page-pad) 0;
+ padding: 14px 24px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius-3);
+ box-shadow: var(--elev-1);
}
.spacer { flex-grow: 1; }
diff --git a/frontend/components/organisms/KpiGrid/KpiGrid.module.css b/frontend/components/organisms/KpiGrid/KpiGrid.module.css
index cd849e4..49c8713 100644
--- a/frontend/components/organisms/KpiGrid/KpiGrid.module.css
+++ b/frontend/components/organisms/KpiGrid/KpiGrid.module.css
@@ -2,7 +2,7 @@
flex-shrink: 0;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 16px;
+ gap: var(--page-gap);
}
/* En un móvil, un indicador por fila: el número enorme no cabe a dos columnas. */
diff --git a/frontend/components/organisms/PalletSideView/PalletSideView.helper.ts b/frontend/components/organisms/PalletSideView/PalletSideView.helper.ts
index 6ffd2a9..9f1ddc1 100644
--- a/frontend/components/organisms/PalletSideView/PalletSideView.helper.ts
+++ b/frontend/components/organisms/PalletSideView/PalletSideView.helper.ts
@@ -26,14 +26,14 @@ export type SideViewModel = {
/** El eje vertical arranca en la superficie del palé (z = 0); el palé se dibuja debajo. */
export function buildSideView(
- placements: Placement[], state: PalletState | null, height = 290,
+ placements: Placement[], state: PalletState | null, height = 250,
size: PalletSize = PALLET_DEFAULT,
): SideViewModel {
const [PX] = size;
const items = drawable(placements);
const top = loadHeight(items);
// Un 25 % de aire sobre la carga para que la cota no toque el borde.
- const zMax = Math.max(top * 1.25, 0.5);
+ const zMax = Math.max(top * 1.25, 0.3);
const scale = (height - PAD.t - PAD.b) / (PALLET_DECK_M + zMax);
const width = PX * scale + PAD.l + PAD.r;
diff --git a/frontend/components/organisms/PalletTopView/PalletTopView.helper.ts b/frontend/components/organisms/PalletTopView/PalletTopView.helper.ts
index 031acf9..ed7cdab 100644
--- a/frontend/components/organisms/PalletTopView/PalletTopView.helper.ts
+++ b/frontend/components/organisms/PalletTopView/PalletTopView.helper.ts
@@ -33,7 +33,7 @@ export type TopViewModel = {
* capa inferior a la del último paquete, que es lo que de verdad lo sostiene.
*/
export function buildTopView(
- placements: Placement[], state: PalletState | null, height = 330,
+ placements: Placement[], state: PalletState | null, height = 290,
size: PalletSize = PALLET_DEFAULT,
): TopViewModel {
const [PX, PY] = size;
diff --git a/frontend/components/organisms/PalletTopView/PalletTopView.tsx b/frontend/components/organisms/PalletTopView/PalletTopView.tsx
index 64a11cc..cdf0615 100644
--- a/frontend/components/organisms/PalletTopView/PalletTopView.tsx
+++ b/frontend/components/organisms/PalletTopView/PalletTopView.tsx
@@ -26,7 +26,7 @@ export function PalletTopView({ placements, state,
{label && (
-
+
)}
))}
diff --git a/frontend/components/organisms/Panel/Panel.module.css b/frontend/components/organisms/Panel/Panel.module.css
index 5aaaec3..d7978f8 100644
--- a/frontend/components/organisms/Panel/Panel.module.css
+++ b/frontend/components/organisms/Panel/Panel.module.css
@@ -1,3 +1,3 @@
.panel { min-height: 0; }
.body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
-.padded { padding: 16px 28px; align-items: center; justify-content: center; }
+.padded { padding: 8px 16px; align-items: center; justify-content: center; }
diff --git a/frontend/components/organisms/RunsTotals/RunsTotals.module.css b/frontend/components/organisms/RunsTotals/RunsTotals.module.css
new file mode 100644
index 0000000..aa61e33
--- /dev/null
+++ b/frontend/components/organisms/RunsTotals/RunsTotals.module.css
@@ -0,0 +1,6 @@
+/* En una pantalla estrecha no cabe junto al logo, las pestañas y el conmutador de tema. */
+.totals { white-space: nowrap; }
+
+@media (max-width: 720px) {
+ .totals { display: none; }
+}
diff --git a/frontend/components/organisms/RunsTotals/RunsTotals.tsx b/frontend/components/organisms/RunsTotals/RunsTotals.tsx
index 82d7d38..3d3c70b 100644
--- a/frontend/components/organisms/RunsTotals/RunsTotals.tsx
+++ b/frontend/components/organisms/RunsTotals/RunsTotals.tsx
@@ -1,8 +1,9 @@
import { Text } from "../../atoms";
import { totalsText } from "./RunsTotals.helper";
+import styles from "./RunsTotals.module.css";
export function RunsTotals({ runs, episodes }: { runs?: number; episodes?: number }) {
const text = totalsText(runs, episodes);
if (!text) return null;
- return {text} ;
+ return {text} ;
}
diff --git a/frontend/components/organisms/TopBar/TopBar.module.css b/frontend/components/organisms/TopBar/TopBar.module.css
index 8db5f53..b5b6907 100644
--- a/frontend/components/organisms/TopBar/TopBar.module.css
+++ b/frontend/components/organisms/TopBar/TopBar.module.css
@@ -1,18 +1,17 @@
.bar {
- height: 48px;
+ height: var(--topbar-h);
flex-shrink: 0;
display: flex;
align-items: center;
gap: 28px;
- padding: 0 28px;
+ padding: 0 var(--page-pad);
background: var(--topbar);
border-bottom: 1px solid var(--border);
}
-.title { letter-spacing: 0.1em; white-space: nowrap; }
-.nav { display: flex; gap: 22px; align-self: stretch; align-items: stretch; }
+.brand { display: inline-flex; text-decoration: none; }
+.nav { display: flex; gap: 6px; }
.spacer { flex-grow: 1; }
@media (max-width: 720px) {
- .bar { gap: 16px; padding: 0 16px; }
- .title { display: none; }
+ .bar { gap: 12px; padding: 0 16px; }
}
diff --git a/frontend/components/organisms/TopBar/TopBar.tsx b/frontend/components/organisms/TopBar/TopBar.tsx
index fcf7201..4a59a5a 100644
--- a/frontend/components/organisms/TopBar/TopBar.tsx
+++ b/frontend/components/organisms/TopBar/TopBar.tsx
@@ -1,16 +1,17 @@
import type { ReactNode } from "react";
-import { Text } from "../../atoms";
+import Link from "next/link";
+import { Logo } from "../../atoms";
import { NavTab } from "../../molecules";
import styles from "./TopBar.module.css";
-/** Barra global. Dos destinos y nada más: la demo (Live) y el análisis (Ejecuciones); Run y
- * Episodio se alcanzan desde la tabla, son detalle. `children` es lo que va a la derecha. */
+/** Barra global: el logo, dos destinos (la demo y el análisis) y, a la derecha, lo que se le
+ * pase. Run y Episodio se alcanzan desde la tabla: son detalle, no secciones. */
export function TopBar({ active, children }: { active: "live" | "runs"; children?: ReactNode }) {
return (
-
- Observabilidad de paletizado
-
+
+
+
Live
Ejecuciones
diff --git a/frontend/components/screens/AppHeader/AppHeader.tsx b/frontend/components/screens/AppHeader/AppHeader.tsx
index 831227b..cd19665 100644
--- a/frontend/components/screens/AppHeader/AppHeader.tsx
+++ b/frontend/components/screens/AppHeader/AppHeader.tsx
@@ -2,6 +2,8 @@
import { usePathname } from "next/navigation";
import { useRunsTotals } from "@/api/hooks";
+import { useTheme } from "@/hooks/useTheme";
+import { ThemeToggle } from "../../molecules";
import { RunsTotals, TopBar } from "../../organisms";
import { activeTab } from "./AppHeader.helper";
@@ -9,12 +11,14 @@ import { activeTab } from "./AppHeader.helper";
export function AppHeader() {
const active = activeTab(usePathname());
const totals = useRunsTotals(active === "runs");
+ const { theme, toggle } = useTheme();
return (
{active === "runs" && (
)}
+
);
}
diff --git a/frontend/components/screens/LiveScreen/LiveScreen.module.css b/frontend/components/screens/LiveScreen/LiveScreen.module.css
index 7c28cf5..39bd4bf 100644
--- a/frontend/components/screens/LiveScreen/LiveScreen.module.css
+++ b/frontend/components/screens/LiveScreen/LiveScreen.module.css
@@ -5,8 +5,8 @@
.screen {
display: flex;
flex-direction: column;
- height: calc(100vh - 48px);
- height: calc(100dvh - 48px);
+ height: calc(100vh - var(--topbar-h));
+ height: calc(100dvh - var(--topbar-h));
min-height: 0;
overflow-y: auto;
}
@@ -15,17 +15,18 @@
min-height: 0;
display: grid;
grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
- gap: 32px;
- padding: 32px;
+ gap: var(--page-gap);
+ padding: var(--page-pad);
}
.stage, .side {
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
- gap: 16px;
+ gap: var(--page-gap);
}
.stage > * { flex: 1; min-height: 200px; }
+.stage > :first-child { flex: 1.4; } /* la vista cenital es el dibujo que define la pantalla */
/* Portátil estrecho: la escena cede un poco para no comerse el estado. */
@media (max-width: 1180px) {
diff --git a/frontend/components/screens/RunsScreen/RunsScreen.module.css b/frontend/components/screens/RunsScreen/RunsScreen.module.css
index 41efe7b..41df6bd 100644
--- a/frontend/components/screens/RunsScreen/RunsScreen.module.css
+++ b/frontend/components/screens/RunsScreen/RunsScreen.module.css
@@ -3,12 +3,12 @@
la comparativa. Si la ventana es tan baja que ni con sus alturas mínimas caben las tres
zonas, scrollea la propia pantalla: mejor eso que recortar contenido inalcanzable. */
.screen {
- height: calc(100vh - 48px);
- height: calc(100dvh - 48px);
+ height: calc(100vh - var(--topbar-h));
+ height: calc(100dvh - var(--topbar-h));
display: flex;
flex-direction: column;
- gap: 16px;
- padding: 32px;
+ gap: var(--page-gap);
+ padding: var(--page-pad);
overflow-y: auto;
}
diff --git a/frontend/hooks/useTheme.ts b/frontend/hooks/useTheme.ts
new file mode 100644
index 0000000..3175683
--- /dev/null
+++ b/frontend/hooks/useTheme.ts
@@ -0,0 +1,29 @@
+import { useCallback, useSyncExternalStore } from "react";
+
+export type Theme = "light" | "dark";
+
+const listeners = new Set<() => void>();
+
+function subscribe(listener: () => void) {
+ listeners.add(listener);
+ return () => { listeners.delete(listener); };
+}
+
+/** La fuente de verdad es el atributo de , que el script de la cabecera fija antes del
+ * primer pintado. Así React nunca disputa el tema con el CSS. */
+function current(): Theme {
+ return document.documentElement.dataset.theme === "dark" ? "dark" : "light";
+}
+
+/** El tema actual y cómo cambiarlo. Recuerda la elección; sin elección, manda el sistema. */
+export function useTheme() {
+ const theme = useSyncExternalStore(subscribe, current, () => "light" as Theme);
+
+ const setTheme = useCallback((next: Theme) => {
+ document.documentElement.dataset.theme = next;
+ try { localStorage.setItem("theme", next); } catch { /* sin almacenamiento: vale para esta visita */ }
+ listeners.forEach((l) => l());
+ }, []);
+
+ return { theme, setTheme, toggle: () => setTheme(theme === "dark" ? "light" : "dark") };
+}
diff --git a/frontend/package.json b/frontend/package.json
index e7499f2..88359fa 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -6,7 +6,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
- "lint": "eslint"
+ "lint": "eslint && node scripts/check-colors.mjs && node scripts/check-contrast.mjs",
+ "lint:colors": "node scripts/check-colors.mjs",
+ "lint:contrast": "node scripts/check-contrast.mjs"
},
"dependencies": {
"@supabase/supabase-js": "^2.116.0",
diff --git a/frontend/public/brand/mark.png b/frontend/public/brand/mark.png
new file mode 100644
index 0000000..b3be39c
Binary files /dev/null and b/frontend/public/brand/mark.png differ
diff --git a/frontend/public/brand/wordmark.png b/frontend/public/brand/wordmark.png
new file mode 100644
index 0000000..5f07f6b
Binary files /dev/null and b/frontend/public/brand/wordmark.png differ
diff --git a/frontend/scripts/check-colors.mjs b/frontend/scripts/check-colors.mjs
new file mode 100644
index 0000000..77284e6
--- /dev/null
+++ b/frontend/scripts/check-colors.mjs
@@ -0,0 +1,83 @@
+/*
+ * Comprueba que no hay colores literales fuera de styles/colors.css.
+ *
+ * Los colores se definen en un solo archivo y el resto los consume con `var(--…)`. Sin
+ * esto, la regla se rompe sola: alguien pega un #hex «solo por esta vez» y el siguiente
+ * cambio de paleta deja una esquina del diseño con el color viejo.
+ *
+ * node scripts/check-colors.mjs (también corre con `npm run lint`)
+ *
+ * Detecta #hex, rgb()/rgba()/hsl()/hsla()/hwb()/lab()/lch()/oklab()/oklch() y colores con
+ * nombre usados como valor. `transparent`, `currentColor` e `inherit` están permitidos:
+ * no son un color concreto.
+ */
+
+import { readdirSync, readFileSync, statSync } from "node:fs";
+import { extname, join, relative, sep } from "node:path";
+
+const ROOT = new URL("..", import.meta.url).pathname;
+const DIRS = ["app", "components", "lib", "api", "hooks", "styles"];
+const EXT = new Set([".css", ".ts", ".tsx"]);
+const ALLOWED = join("styles", "colors.css");
+
+const NAMED = "white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|cyan|magenta|" +
+ "silver|gold|brown|navy|teal|lime|maroon|olive|aqua|fuchsia";
+
+const RULES = [
+ { name: "#hex", re: /(? m.replace(/[^\n]/g, " ");
+ return source
+ .replace(/\/\*[\s\S]*?\*\//g, blank)
+ .replace(/(^|[^:\\])\/\/.*$/gm, (m, pre) => pre + " ".repeat(m.length - pre.length));
+}
+
+const problems = [];
+for (const dir of DIRS) {
+ let files = [];
+ try { files = walk(join(ROOT, dir)); } catch { continue; }
+ for (const file of files) {
+ const rel = relative(ROOT, file);
+ if (rel === ALLOWED) continue;
+ const lines = stripComments(readFileSync(file, "utf8")).split("\n");
+ lines.forEach((line, i) => {
+ for (const { name, re } of RULES) {
+ for (const m of line.matchAll(re)) {
+ problems.push(`${rel.split(sep).join("/")}:${i + 1} ${name}: ${m[0].trim()}`);
+ }
+ }
+ });
+ }
+}
+
+if (problems.length) {
+ console.error(`Colores literales fuera de styles/colors.css (${problems.length}):\n`);
+ for (const p of problems) console.error(" " + p);
+ console.error("\nDefine el color como variable en styles/colors.css y usa `var(--nombre)`.");
+ process.exit(1);
+}
+console.log("colores: ok (todo sale de styles/colors.css)");
diff --git a/frontend/scripts/check-contrast.mjs b/frontend/scripts/check-contrast.mjs
new file mode 100644
index 0000000..74dfafa
--- /dev/null
+++ b/frontend/scripts/check-contrast.mjs
@@ -0,0 +1,61 @@
+/*
+ * Comprueba el contraste (WCAG 2.x) de los pares de color que llevan texto, en los dos
+ * temas de styles/colors.css. Un gris que «se ve bien» en el portátil de quien lo eligió
+ * puede no leerse en la pantalla de la sala.
+ *
+ * node scripts/check-contrast.mjs (también corre con `npm run lint`)
+ *
+ * Texto: 4.5:1. Elementos gráficos con significado (estado, selección): 3:1.
+ */
+
+import { readFileSync } from "node:fs";
+
+const css = readFileSync(new URL("../styles/colors.css", import.meta.url), "utf8")
+ .replace(/\/\*[\s\S]*?\*\//g, "");
+
+/** Variables de un bloque, sin resolver `var()` (los valores de la capa base son #hex). */
+function block(selectorStart) {
+ const i = css.indexOf(selectorStart);
+ const body = css.slice(css.indexOf("{", i) + 1, css.indexOf("\n}", i));
+ return Object.fromEntries([...body.matchAll(/(--[\w-]+)\s*:\s*(#[0-9a-fA-F]{6})\b/g)]
+ .map((m) => [m[1], m[2]]));
+}
+
+const themes = {
+ claro: block(":root,\n:root[data-theme=\"light\"]"),
+ oscuro: block(":root[data-theme=\"dark\"]"),
+};
+
+const lum = (hex) => {
+ const c = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255)
+ .map((v) => (v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4));
+ return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
+};
+const ratio = (a, b) => {
+ const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x);
+ return (hi + 0.05) / (lo + 0.05);
+};
+
+const TEXT = ["--text", "--text-2", "--text-3", "--text-4", "--link", "--ok", "--warn", "--bad",
+ "--oracle", "--synthetic"];
+const GRAPHIC = ["--select", "--control-border"];
+const failures = [];
+let checked = 0;
+
+for (const [name, t] of Object.entries(themes)) {
+ const check = (fg, bg, min) => {
+ checked++;
+ const r = ratio(t[fg], t[bg]);
+ if (r < min) failures.push(`${name}: ${fg} sobre ${bg} = ${r.toFixed(2)}:1 (mínimo ${min})`);
+ };
+ for (const fg of TEXT) for (const bg of ["--bg", "--surface"]) check(fg, bg, 4.5);
+ for (const fg of GRAPHIC) for (const bg of ["--bg", "--surface"]) check(fg, bg, 3);
+ check("--on-select", "--select", 4.5);
+}
+
+if (failures.length) {
+ console.error(`Contraste insuficiente (${failures.length}):\n`);
+ for (const f of failures) console.error(" " + f);
+ process.exit(1);
+}
+console.log(`contraste: ok (${checked} pares, 2 temas)`);
diff --git a/frontend/styles/colors.css b/frontend/styles/colors.css
new file mode 100644
index 0000000..1f1a1af
--- /dev/null
+++ b/frontend/styles/colors.css
@@ -0,0 +1,166 @@
+/*
+ * Colores de la plataforma. ÚNICO sitio donde se define un color: ningún otro archivo del
+ * front (CSS, TS ni TSX) lleva un literal (#hex, rgb(), hsl()…); solo referencias
+ * `var(--…)`. `npm run lint` lo comprueba (scripts/check-colors.mjs).
+ *
+ * Identidad: la del logo de STACKSPECT, línea blanca sobre negro. Por eso la interfaz es
+ * en blanco y negro, con dos temas —claro y oscuro— que comparten nombres y significado:
+ * cambiar de tema es sobrescribir la capa base, y los derivados se recalculan solos.
+ *
+ * El color con significado se queda, en los dos temas, porque es información y no adorno:
+ * verde / ámbar / rojo los tres estados (nada más los usa)
+ * rosa datos con oracle
+ * violeta datos sembrados
+ * una identidad por causa de fallo
+ * Todo lo demás es escala de grises. La selección y la interacción van en «tinta»
+ * (--select: negro en claro, blanco en oscuro), no en un color.
+ *
+ * Contraste (WCAG AA): los textos --text a --text-4 y los tres estados llegan a 4.5:1
+ * sobre --bg y --surface en los dos temas. `npm run lint:contrast` lo comprueba.
+ * --text-5 es decorativo (líneas, iconos apagados): nunca para texto.
+ *
+ * Capas, de dentro afuera:
+ * 1. Base por tema la paleta (aquí abajo, dos bloques).
+ * 2. Derivados el mismo color con transparencia, con nombre por su USO.
+ * 3. (los componentes solo consumen 1 y 2)
+ */
+
+/* ── 1. Base · tema claro (por defecto) ───────────────────────────────────── */
+
+:root,
+:root[data-theme="light"] {
+ /* Neutros. El fondo no es blanco puro: el blanco queda para las tarjetas, que así se
+ despegan sin necesitar sombras fuertes. */
+ --bg: #F5F5F3;
+ --surface: #FFFFFF;
+ --topbar: #FFFFFF;
+ --border: #E4E4E0;
+ --border-soft: #EDEDEA;
+ --border-hard: #C9C9C4; /* marcos decorativos (dibujo del palé, separadores fuertes) */
+ --control-border: #85858D; /* borde de un control: casilla, selector, botón. ≥ 3:1 */
+ --row-alt: #FAFAF8;
+ --row-hover: #F2F2EF;
+
+ --text: #0A0A0B;
+ --text-2: #3A3A40;
+ --text-3: #55555C;
+ --text-4: #6C6C74;
+ --text-5: #A5A5AD;
+
+ /* Tinta: selección e interacción. Nunca significa estado. */
+ --select: #0A0A0B;
+ --on-select: #FFFFFF; /* lo que se pinta encima de --select (la marca de una casilla) */
+ --link: #0A0A0B;
+ --link-hover: #55555C;
+
+ /* Semántica de color: tres significados y ninguno más. */
+ --ok: #15803D;
+ --warn: #B45309;
+ --bad: #C62828;
+
+ /* Números que no son de verdad. Molestan a la vista a propósito. */
+ --oracle: #C81E78;
+ --synthetic: #6D28D9;
+
+ /* Una identidad de color por causa de fallo, constante en toda la aplicación. */
+ --f-no_detection: #64748B;
+ --f-grasp_slip: #A16207;
+ --f-ik_unreachable: #2563EB;
+ --f-wrong_placement: #6D5BD0;
+ --f-collision: #B03A54;
+ --f-stack_collapse: #EA580C;
+ --f-timeout: #475569;
+ --f-overhang_violation: #0E9F9A;
+ --f-place_inaccurate: #8B5E3C;
+
+ /* Marca, sombras y elevación. */
+ --logo: var(--text);
+ --shadow-ink: #000000;
+ --elev-1: 0 1px 2px color-mix(in srgb, var(--shadow-ink) 5%, transparent),
+ 0 1px 3px color-mix(in srgb, var(--shadow-ink) 4%, transparent);
+ --elev-2: 0 8px 24px color-mix(in srgb, var(--shadow-ink) 10%, transparent);
+
+ color-scheme: light;
+}
+
+/* ── 1. Base · tema oscuro (el del logo) ──────────────────────────────────── */
+
+:root[data-theme="dark"] {
+ --bg: #0A0A0B;
+ --surface: #131315;
+ --topbar: #0A0A0B;
+ --border: #26262A;
+ --border-soft: #1C1C20;
+ --border-hard: #3A3A40;
+ --control-border: #6B6B73;
+ --row-alt: #101012;
+ --row-hover: #1A1A1D;
+
+ --text: #F4F4F5;
+ --text-2: #C7C7CC;
+ --text-3: #A1A1A8;
+ --text-4: #85858D;
+ --text-5: #55555C;
+
+ --select: #F4F4F5;
+ --on-select: #0A0A0B;
+ --link: #F4F4F5;
+ --link-hover: #A1A1A8;
+
+ --ok: #3DD68C;
+ --warn: #F0B24B;
+ --bad: #FF6B62;
+
+ --oracle: #FF5CB0;
+ --synthetic: #B692FF;
+
+ --f-no_detection: #7A8B99;
+ --f-grasp_slip: #C9A227;
+ --f-ik_unreachable: #5B9DD9;
+ --f-wrong_placement: #8C7AE6;
+ --f-collision: #B5485E;
+ --f-stack_collapse: #FF7A45;
+ --f-timeout: #4A5A66;
+ --f-overhang_violation: #00A9A5;
+ --f-place_inaccurate: #A0785A;
+
+ --logo: var(--text);
+ --shadow-ink: #000000;
+ --elev-1: 0 1px 2px color-mix(in srgb, var(--shadow-ink) 40%, transparent);
+ --elev-2: 0 12px 32px color-mix(in srgb, var(--shadow-ink) 55%, transparent);
+
+ color-scheme: dark;
+}
+
+/* ── 2. Derivados, por uso (iguales en los dos temas) ─────────────────────── */
+
+:root {
+ /* Relleno de lo seleccionado. */
+ --select-row: color-mix(in srgb, var(--select) 7%, transparent); /* fila de tabla */
+ --select-fill: color-mix(in srgb, var(--select) 14%, transparent); /* último paquete, muestra de leyenda */
+
+ /* Rellenos del dibujo del palé. */
+ --neutral-fill: color-mix(in srgb, var(--text-2) 10%, transparent); /* paquete colocado */
+ --bad-fill: color-mix(in srgb, var(--bad) 16%, transparent); /* paquete fuera de tolerancia */
+
+ /* Aviso de conexión perdida. */
+ --warn-banner: color-mix(in srgb, var(--warn) 10%, transparent);
+
+ /* Datos que no son de verdad: tinte del interruptor y color de las franjas diagonales. */
+ --oracle-fill: color-mix(in srgb, var(--oracle) 8%, transparent);
+ --oracle-stripe: color-mix(in srgb, var(--oracle) 16%, transparent);
+ --synthetic-stripe: color-mix(in srgb, var(--synthetic) 16%, transparent);
+ --synthetic-stripe-soft: color-mix(in srgb, var(--synthetic) 10%, transparent);
+
+ /* Tinte suave de cada estado: fondo de una etiqueta o de un mensaje. */
+ --ok-fill: color-mix(in srgb, var(--ok) 10%, transparent);
+ --warn-fill: color-mix(in srgb, var(--warn) 10%, transparent);
+ --bad-fill-soft: color-mix(in srgb, var(--bad) 8%, transparent);
+
+ /* Halo del punto de estado cuando late (Dot). */
+ --ok-halo: color-mix(in srgb, var(--ok) 25%, transparent);
+ --warn-halo: color-mix(in srgb, var(--warn) 25%, transparent);
+ --bad-halo: color-mix(in srgb, var(--bad) 25%, transparent);
+ --light-halo: color-mix(in srgb, var(--text) 18%, transparent);
+ --muted-halo: color-mix(in srgb, var(--text-4) 25%, transparent);
+}