| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- @import "tailwindcss";
- @import "tw-animate-css";
- @custom-variant dark (&:is(.dark *));
- /* NetPulse design tokens — dark-first (design.md §3). Default = dark "NOC doméstico". */
- /* .dark permite forzar el tema oscuro en previews dentro de páginas claras */
- @layer base {
- :root,
- .dark {
- --canvas: 7 11 18; /* #070B12 */
- --surface: 13 20 32; /* #0D1420 */
- --elevated: 19 28 44; /* #131C2C */
- --hover: 26 36 54; /* #1A2436 */
- --border: 30 42 61; /* #1E2A3D */
- --border-strong: 42 58 82; /* #2A3A52 */
- --text-primary: 232 238 247; /* #E8EEF7 */
- --text-secondary: 154 168 188; /* #9AA8BC */
- --text-muted: 91 107 130; /* #5B6B82 */
- --accent: 34 211 238; /* #22D3EE cyan-400 */
- --tunnel: 167 139 250; /* #A78BFA violet-400 */
- --ok: 52 211 153; /* #34D399 emerald-400 */
- --warn: 251 191 36; /* #FBBF24 amber-400 */
- --danger: 248 113 113; /* #F87171 red-400 */
- --info: 96 165 250; /* #60A5FA blue-400 */
- --radius: 0.625rem; /* 10px */
- color-scheme: dark;
- }
- /* Light theme — toggled via .light class on <html> (o en un contenedor para previews) */
- html.light,
- .light {
- --canvas: 243 245 249; /* #F3F5F9 */
- --surface: 255 255 255;
- --elevated: 255 255 255;
- --hover: 241 245 249; /* slate-100 */
- --border: 226 232 240; /* #E2E8F0 */
- --border-strong: 203 213 225;
- --text-primary: 15 23 42; /* #0F172A */
- --text-secondary: 71 85 105; /* #475569 */
- --text-muted: 100 116 139; /* slate-500, AA sobre surface */
- --accent: 8 145 178; /* #0891B2 cyan-600 */
- --tunnel: 124 58 237; /* violet-600 */
- --ok: 5 150 105; /* emerald-600 */
- --warn: 217 119 6; /* amber-600 */
- --danger: 220 38 38; /* red-600 */
- --info: 37 99 235; /* blue-600 */
- color-scheme: light;
- }
- }
- /* Design tokens → Tailwind 4 @theme (equivalente al theme.extend de v3).
- En v4 los colores van PUROS (sin <alpha-value>); la opacidad (bg-x/50)
- la gestiona Tailwind con color-mix automático. */
- @theme {
- --color-canvas: rgb(var(--canvas));
- --color-surface: rgb(var(--surface));
- --color-elevated: rgb(var(--elevated));
- --color-hover: rgb(var(--hover));
- --color-border: rgb(var(--border));
- --color-border-strong: rgb(var(--border-strong));
- --color-text-primary: rgb(var(--text-primary));
- --color-text-secondary: rgb(var(--text-secondary));
- --color-text-muted: rgb(var(--text-muted));
- --color-accent: rgb(var(--accent));
- --color-accent-soft: rgb(var(--accent) / 0.12);
- --color-tunnel: rgb(var(--tunnel));
- --color-ok: rgb(var(--ok));
- --color-warn: rgb(var(--warn));
- --color-danger: rgb(var(--danger));
- --color-info: rgb(var(--info));
- /* shadcn/ui aliases mapeados a los tokens de diseño */
- --color-background: rgb(var(--canvas));
- --color-foreground: rgb(var(--text-primary));
- --color-input: rgb(var(--border-strong));
- --color-ring: rgb(var(--accent));
- --color-primary: rgb(var(--accent));
- --color-primary-foreground: rgb(var(--canvas));
- --color-secondary: rgb(var(--elevated));
- --color-secondary-foreground: rgb(var(--text-primary));
- --color-destructive: rgb(var(--danger));
- --color-destructive-foreground: rgb(var(--canvas));
- --color-muted: rgb(var(--elevated));
- --color-muted-foreground: rgb(var(--text-muted));
- --color-popover: rgb(var(--elevated));
- --color-popover-foreground: rgb(var(--text-primary));
- --color-card: rgb(var(--surface));
- --color-card-foreground: rgb(var(--text-primary));
- --color-sidebar: rgb(var(--surface));
- --color-sidebar-foreground: rgb(var(--text-primary));
- --color-sidebar-primary: rgb(var(--accent));
- --color-sidebar-primary-foreground: rgb(var(--canvas));
- --color-sidebar-accent: rgb(var(--accent) / 0.12);
- --color-sidebar-accent-foreground: rgb(var(--accent));
- --color-sidebar-border: rgb(var(--border));
- --color-sidebar-ring: rgb(var(--accent));
- --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
- --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
- --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
- --text-display: 2.75rem;
- --text-display--line-height: 1.1;
- --text-display--font-weight: 700;
- --text-display-sm: 2.25rem;
- --text-display-sm--line-height: 1.1;
- --text-display-sm--font-weight: 700;
- --text-h1: 1.5rem;
- --text-h1--line-height: 1.2;
- --text-h1--font-weight: 600;
- --text-h2: 1.125rem;
- --text-h2--line-height: 1.3;
- --text-h2--font-weight: 600;
- --text-stat: 1.75rem;
- --text-stat--line-height: 1.1;
- --text-stat--font-weight: 600;
- --text-label: 0.75rem;
- --text-label--line-height: 1.4;
- --text-label--font-weight: 500;
- --text-label--letter-spacing: 0.06em;
- --text-caption: 0.6875rem;
- --text-caption--line-height: 1.4;
- --text-caption--font-weight: 500;
- --text-mono-sm: 0.75rem;
- --text-mono-sm--line-height: 1.4;
- --text-mono-sm--font-weight: 500;
- --radius-xs: calc(var(--radius) - 6px);
- --radius-sm: calc(var(--radius) - 4px);
- --radius-md: calc(var(--radius) - 2px);
- --radius-lg: var(--radius);
- --radius-xl: calc(var(--radius) + 2px);
- --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
- --shadow-glow-ok: 0 0 40px -12px rgb(var(--ok) / 0.35);
- --shadow-glow-warn: 0 0 40px -12px rgb(var(--warn) / 0.35);
- --shadow-glow-danger: 0 0 40px -12px rgb(var(--danger) / 0.35);
- --shadow-glow-accent: 0 0 40px -12px rgb(var(--accent) / 0.35);
- --shadow-glow-tunnel: 0 0 40px -12px rgb(var(--tunnel) / 0.35);
- --animate-accordion-down: accordion-down 0.2s ease-out;
- --animate-accordion-up: accordion-up 0.2s ease-out;
- --animate-caret-blink: caret-blink 1.25s ease-out infinite;
- --animate-ping-soft: ping-soft 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
- @keyframes accordion-down {
- from { height: 0; }
- to { height: var(--radix-accordion-content-height); }
- }
- @keyframes accordion-up {
- from { height: var(--radix-accordion-content-height); }
- to { height: 0; }
- }
- @keyframes caret-blink {
- 0%, 70%, 100% { opacity: 1; }
- 20%, 50% { opacity: 0; }
- }
- @keyframes ping-soft {
- 0% { transform: scale(1); opacity: 0.7; }
- 80%, 100% { transform: scale(2.2); opacity: 0; }
- }
- }
- @layer base {
- * {
- @apply border-border;
- }
- html {
- -webkit-tap-highlight-color: transparent;
- }
- body {
- @apply bg-canvas text-text-primary font-sans antialiased;
- font-size: 0.875rem;
- line-height: 1.5;
- transition: background-color 200ms ease, color 200ms ease;
- }
- .font-mono,
- code,
- kbd {
- font-feature-settings: "tnum";
- }
- ::selection {
- background: rgb(var(--accent) / 0.25);
- }
- :focus-visible {
- outline: 2px solid rgb(var(--accent));
- outline-offset: 2px;
- border-radius: 4px;
- }
- /* Scrollbar discreto acorde al tema */
- ::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- }
- ::-webkit-scrollbar-thumb {
- background: rgb(var(--border-strong));
- border-radius: 999px;
- border: 2px solid rgb(var(--canvas));
- }
- ::-webkit-scrollbar-track {
- background: transparent;
- }
- }
- @layer utilities {
- /* Surface hierarchy (#21): elevated cards get accent glow + stronger border */
- .surface-elevated {
- border-color: rgb(var(--border-strong));
- box-shadow:
- 0 0 0 1px rgb(var(--accent) / 0.08),
- 0 4px 24px -8px rgb(var(--accent) / 0.12);
- }
- .surface-featured {
- border-color: rgb(var(--accent) / 0.25);
- background: linear-gradient(
- 135deg,
- rgb(var(--surface)) 0%,
- rgb(var(--accent) / 0.03) 100%
- );
- box-shadow:
- 0 0 0 1px rgb(var(--accent) / 0.1),
- 0 8px 32px -12px rgb(var(--accent) / 0.18);
- }
- /* Status glows (#21): subtle border glow for health states */
- .glow-ok { box-shadow: 0 0 20px -8px rgb(var(--ok) / 0.3); }
- .glow-warn { box-shadow: 0 0 20px -8px rgb(var(--warn) / 0.3); }
- .glow-danger { box-shadow: 0 0 20px -8px rgb(var(--danger) / 0.3); }
- .glow-accent { box-shadow: 0 0 20px -8px rgb(var(--accent) / 0.3); }
- /* KPI typography (#22): display font + tabular nums for hero metrics */
- .kpi-value {
- font-family: var(--font-display);
- font-feature-settings: "tnum";
- font-variant-numeric: tabular-nums;
- letter-spacing: -0.02em;
- }
- .kpi-delta-up {
- color: rgb(var(--ok));
- }
- .kpi-delta-down {
- color: rgb(var(--danger));
- }
- .kpi-delta-flat {
- color: rgb(var(--text-muted));
- }
- /* SSE flash (#22): brief highlight when a value updates via SSE */
- .flash-sse {
- animation: kpi-flash 0.6s ease-out;
- }
- @keyframes kpi-flash {
- 0% { background-color: rgb(var(--accent) / 0.15); }
- 100% { background-color: transparent; }
- }
- /* Count-up entrance (#22) */
- .count-up-enter {
- animation: count-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
- }
- @keyframes count-up {
- from { opacity: 0; transform: translateY(8px); }
- to { opacity: 1; transform: translateY(0); }
- }
- /* Safe areas (PWA, design.md §12) */
- .pt-safe {
- padding-top: env(safe-area-inset-top);
- }
- .pb-safe {
- padding-bottom: env(safe-area-inset-bottom);
- }
- .pl-safe {
- padding-left: env(safe-area-inset-left);
- }
- .pr-safe {
- padding-right: env(safe-area-inset-right);
- }
- .h-tabbar {
- height: calc(4rem + env(safe-area-inset-bottom));
- }
- .mesh-bg {
- background-image: url('/mesh-texture.svg');
- background-repeat: repeat;
- background-size: 400px 400px;
- }
- .text-balance {
- text-wrap: balance;
- }
- }
- /* Reduced motion: desactiva pulses/tweens (design.md §8, §13) */
- @media (prefers-reduced-motion: reduce) {
- *,
- *::before,
- *::after {
- animation-duration: 0.01ms !important;
- animation-iteration-count: 1 !important;
- transition-duration: 0.01ms !important;
- scroll-behavior: auto !important;
- }
- }
- /* Transición móvil entre vistas: el contenido (<main>) se desliza y el shell
- * (header móvil + bottom nav) permanece estático. Se capturan como grupos de
- * view-transition PROPIO (netpulse-header/netpulse-nav) para no depender de
- * cómo el navegador capture el grupo root con position:fixed (falla en
- * dispositivos). */
- @media (max-width: 767px) {
- main {
- view-transition-name: netpulse-content;
- }
- /* El shell queda estático: anulamos las 4 animaciones UA de cada grupo
- * (group/image-pair arrancan en opacity 0 en la hoja UA del navegador). */
- ::view-transition-group(root),
- ::view-transition-image-pair(root),
- ::view-transition-old(root),
- ::view-transition-new(root),
- ::view-transition-group(netpulse-header),
- ::view-transition-image-pair(netpulse-header),
- ::view-transition-old(netpulse-header),
- ::view-transition-new(netpulse-header),
- ::view-transition-group(netpulse-nav),
- ::view-transition-image-pair(netpulse-nav),
- ::view-transition-old(netpulse-nav),
- ::view-transition-new(netpulse-nav) {
- animation: none;
- }
- html[data-nav-dir='forward']::view-transition-old(netpulse-content) {
- animation: netpulse-vt-out-left 0.3s ease-in-out both;
- }
- html[data-nav-dir='forward']::view-transition-new(netpulse-content) {
- animation: netpulse-vt-in-right 0.3s ease-in-out both;
- }
- html[data-nav-dir='back']::view-transition-old(netpulse-content) {
- animation: netpulse-vt-out-right 0.3s ease-in-out both;
- }
- html[data-nav-dir='back']::view-transition-new(netpulse-content) {
- animation: netpulse-vt-in-left 0.3s ease-in-out both;
- }
- }
- @keyframes netpulse-vt-out-left {
- to {
- transform: translateX(-24%);
- opacity: 0.7;
- }
- }
- @keyframes netpulse-vt-in-right {
- from {
- transform: translateX(24%);
- opacity: 0.7;
- }
- }
- @keyframes netpulse-vt-out-right {
- to {
- transform: translateX(24%);
- opacity: 0.7;
- }
- }
- @keyframes netpulse-vt-in-left {
- from {
- transform: translateX(-24%);
- opacity: 0.7;
- }
- }
- /* Reducir animaciones para las view transitions (SO) */
- @media (prefers-reduced-motion: reduce) {
- ::view-transition-old(*),
- ::view-transition-new(*) {
- animation: none !important;
- }
- }
|