Files
Autoparts-DB/pos/templates/dashboard.html
consultoria-as e95f7cf684 feat: complete session — catalog, marketplace, WhatsApp, peer-to-peer, install scripts
Major features:
- Pixel-Perfect glassmorphism design (landing + POS + public catalog)
- OEM/Local catalog toggle with Nexpart taxonomy (14 groups, 108 subgroups, 558 part types)
- Marketplace B2B Phase 1 (bodegas, POs, status machine, WA+email notifications)
- Peer-to-peer inventory (multi-instance, LAN discovery)
- WhatsApp: photo→Vision AI, voice→Whisper, conversational quotations
- Smart unified search (VIN/plate/part_number/keyword auto-detect)
- Shop Supplies tab (vehicle-independent parts)
- Chatbot AI fallback chain (5 models) + response cache
- CSV inventory import tool + setup_instance.sh installer
- Tablet-responsive CSS + sidebar toggle
- Filters, export CSV, employee edit, business data save
- Quotation system (WA→POS) with auto-print on confirmation
- Live stats on landing page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 05:35:53 +00:00

1699 lines
51 KiB
HTML

<!DOCTYPE html>
<html lang="es" data-theme="industrial">
<head>
<script>/*pos_theme_early*/(function(){var t=localStorage.getItem("pos_theme")||"industrial";document.documentElement.setAttribute("data-theme",t);})()</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nexus Autoparts — Dashboard</title>
<link rel="stylesheet" href="/pos/static/css/tokens.css" />
<link rel="stylesheet" href="/pos/static/css/pos-glass.css" />
<link rel="manifest" href="/pos/static/pwa/manifest.json" />
<meta name="theme-color" content="#F5A623" />
<style>
/* ==========================================================================
BASE RESET
========================================================================== */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
font-family: var(--font-body);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-regular);
background-color: var(--color-bg-base);
color: var(--color-text-primary);
min-height: 100vh;
display: flex;
flex-direction: column;
transition: background-color var(--duration-normal) var(--ease-in-out),
color var(--duration-normal) var(--ease-in-out);
}
/* Modern theme dot-grid on body */
[data-theme="modern"] body {
background-color: var(--color-bg-base);
background-image: radial-gradient(
circle,
var(--dot-grid-color) 1px,
transparent 1px
);
background-size: var(--dot-grid-size) var(--dot-grid-size);
}
a {
text-decoration: none;
color: inherit;
}
/* ==========================================================================
THEME SWITCHER BAR (fixed top, 36px)
========================================================================== */
.theme-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 36px;
z-index: var(--z-sticky);
background-color: var(--color-surface-3);
border-bottom: 1px solid var(--color-border);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-5);
font-size: var(--text-caption);
font-family: var(--font-body);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wide);
}
.theme-bar__brand {
font-family: var(--font-heading);
font-weight: var(--font-weight-bold);
font-size: 0.8125rem;
color: var(--color-primary);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
}
.theme-bar__controls {
display: flex;
align-items: center;
gap: var(--space-4);
}
.theme-bar__label {
font-size: var(--text-caption);
color: var(--color-text-muted);
}
.theme-switcher {
display: flex;
align-items: center;
gap: var(--space-1);
background-color: var(--color-surface-2);
border: 1px solid var(--color-border);
border-radius: var(--radius-full);
padding: 2px;
}
.theme-btn {
height: 22px;
padding: 0 var(--space-3);
border-radius: var(--radius-full);
border: none;
cursor: pointer;
font-family: var(--font-body);
font-size: 11px;
font-weight: var(--font-weight-semibold);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
background: transparent;
color: var(--color-text-muted);
transition: var(--transition-fast);
}
.theme-btn.active {
background-color: var(--color-primary);
color: var(--color-text-inverse);
}
.theme-btn:not(.active):hover {
color: var(--color-text-primary);
}
/* ==========================================================================
APP SHELL — sidebar + main
========================================================================== */
.app-shell {
display: flex;
flex: 1;
margin-top: 36px; /* offset for fixed theme bar */
min-height: calc(100vh - 36px);
position: relative;
}
/* ==========================================================================
SIDEBAR
========================================================================== */
.sidebar {
width: 260px;
flex-shrink: 0;
background-color: var(--color-bg-elevated);
border-right: 1px solid var(--color-border);
display: flex;
flex-direction: column;
position: fixed;
top: 36px;
left: 0;
bottom: 0;
z-index: var(--z-dropdown);
transition: transform var(--duration-normal) var(--ease-in-out);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.sidebar__logo {
padding: var(--space-5) var(--space-5) var(--space-4);
border-bottom: 1px solid var(--color-border);
}
.sidebar__logo-text {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: 1.125rem;
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
color: var(--color-primary);
line-height: 1;
}
.sidebar__logo-sub {
font-size: var(--text-caption);
color: var(--color-text-muted);
margin-top: 2px;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.sidebar__nav {
flex: 1;
padding: var(--space-4) 0;
}
.sidebar__section-label {
font-size: 10px;
font-weight: var(--font-weight-bold);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
color: var(--color-text-muted);
padding: var(--space-3) var(--space-5) var(--space-2);
margin-top: var(--space-2);
}
.nav-link {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-5);
color: var(--color-text-secondary);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-regular);
transition: var(--transition-fast);
border-left: 3px solid transparent;
position: relative;
}
.nav-link:hover {
background-color: var(--color-surface-2);
color: var(--color-text-primary);
}
.nav-link.active {
background-color: var(--color-primary-muted);
color: var(--color-primary);
border-left-color: var(--color-primary);
font-weight: var(--font-weight-semibold);
}
.nav-link__icon {
width: 18px;
height: 18px;
flex-shrink: 0;
opacity: 0.7;
display: flex;
align-items: center;
justify-content: center;
}
.nav-link.active .nav-link__icon {
opacity: 1;
}
.sidebar__footer {
padding: var(--space-4) var(--space-5);
border-top: 1px solid var(--color-border);
}
.user-chip {
display: flex;
align-items: center;
gap: var(--space-3);
}
.user-chip__avatar {
width: 32px;
height: 32px;
border-radius: var(--radius-full);
background-color: var(--color-primary);
color: var(--color-text-inverse);
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-heading);
font-weight: var(--font-weight-bold);
font-size: 13px;
flex-shrink: 0;
}
.user-chip__info {
flex: 1;
min-width: 0;
}
.user-chip__name {
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-chip__role {
font-size: var(--text-caption);
color: var(--color-text-muted);
}
/* ==========================================================================
SIDEBAR OVERLAY (mobile backdrop)
========================================================================== */
.sidebar-overlay {
display: none;
position: fixed;
inset: 0;
top: 36px;
background-color: var(--overlay-backdrop);
z-index: calc(var(--z-dropdown) - 1);
}
/* ==========================================================================
MAIN CONTENT
========================================================================== */
.main {
flex: 1;
margin-left: 220px;
min-width: 0;
display: flex;
flex-direction: column;
}
/* ==========================================================================
TOP HEADER BAR
========================================================================== */
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-6);
background-color: var(--color-bg-elevated);
border-bottom: 1px solid var(--color-border);
gap: var(--space-4);
flex-shrink: 0;
}
.header__left {
display: flex;
align-items: center;
gap: var(--space-4);
}
.hamburger-btn {
display: none;
width: 36px;
height: 36px;
background: none;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
cursor: pointer;
color: var(--color-text-secondary);
align-items: center;
justify-content: center;
transition: var(--transition-fast);
}
.hamburger-btn:hover {
background-color: var(--color-surface-2);
color: var(--color-text-primary);
}
.header__greeting {
display: flex;
flex-direction: column;
}
.header__title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: var(--text-h5);
letter-spacing: var(--heading-tracking-h5);
color: var(--color-text-primary);
line-height: 1.2;
}
.header__subtitle {
font-size: var(--text-caption);
color: var(--color-text-muted);
margin-top: 1px;
}
.header__right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.header__store-badge {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-4);
background-color: var(--color-primary-muted);
border: 1px solid var(--color-border-accent);
border-radius: var(--radius-md);
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-primary);
letter-spacing: var(--tracking-wide);
}
.icon-btn {
width: 36px;
height: 36px;
background: none;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
cursor: pointer;
color: var(--color-text-secondary);
display: flex;
align-items: center;
justify-content: center;
transition: var(--transition-fast);
position: relative;
}
.icon-btn:hover {
background-color: var(--color-surface-2);
color: var(--color-text-primary);
}
.notif-dot {
position: absolute;
top: 6px;
right: 6px;
width: 7px;
height: 7px;
border-radius: var(--radius-full);
background-color: var(--color-error);
border: 1.5px solid var(--color-bg-elevated);
}
/* ==========================================================================
DASHBOARD CONTENT AREA
========================================================================== */
.dashboard {
flex: 1;
padding: var(--space-6);
display: flex;
flex-direction: column;
gap: var(--space-6);
overflow-y: auto;
}
/* ==========================================================================
SECTION TITLE
========================================================================== */
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.section-title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-secondary);
font-size: var(--text-h6);
letter-spacing: var(--heading-tracking-h6);
text-transform: uppercase;
color: var(--color-text-secondary);
}
.section-action {
font-size: var(--text-caption);
color: var(--color-primary);
font-weight: var(--font-weight-semibold);
cursor: pointer;
letter-spacing: var(--tracking-wide);
}
.section-action:hover {
text-decoration: underline;
}
/* ==========================================================================
KPI CARDS ROW
========================================================================== */
.kpi-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-4);
}
.kpi-card {
background-color: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-5);
display: flex;
flex-direction: column;
gap: var(--space-3);
transition: var(--transition-normal);
position: relative;
overflow: hidden;
}
[data-theme="industrial"] .kpi-card {
box-shadow: var(--shadow-sm);
}
[data-theme="modern"] .kpi-card {
box-shadow: var(--shadow-md);
}
.kpi-card:hover {
border-color: var(--color-border-strong);
transform: translateY(-1px);
}
.kpi-card__accent-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background-color: var(--color-primary);
}
.kpi-card__label {
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
color: var(--color-text-muted);
display: flex;
align-items: center;
justify-content: space-between;
}
.kpi-card__icon {
width: 28px;
height: 28px;
border-radius: var(--radius-md);
background-color: var(--color-primary-muted);
display: flex;
align-items: center;
justify-content: center;
color: var(--color-primary);
}
.kpi-card__value {
font-family: var(--font-mono);
font-size: 1.625rem;
font-weight: var(--font-weight-bold);
color: var(--color-text-primary);
line-height: 1;
letter-spacing: var(--tracking-tight);
}
.kpi-card__meta {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-caption);
}
.kpi-tag {
display: inline-flex;
align-items: center;
gap: 2px;
font-size: 11px;
font-weight: var(--font-weight-semibold);
padding: 2px var(--space-2);
border-radius: var(--radius-full);
}
.kpi-tag--up {
background-color: rgba(34, 197, 94, 0.15);
color: var(--color-success);
}
.kpi-tag--neutral {
background-color: var(--color-surface-2);
color: var(--color-text-muted);
}
.kpi-meta-text {
color: var(--color-text-muted);
}
/* Progress bar inside KPI */
.kpi-progress {
margin-top: var(--space-1);
}
.kpi-progress__track {
height: 4px;
background-color: var(--color-surface-3);
border-radius: var(--radius-full);
overflow: hidden;
}
.kpi-progress__fill {
height: 100%;
background-color: var(--color-primary);
border-radius: var(--radius-full);
transition: width var(--duration-slow) var(--ease-out);
}
.kpi-progress__label {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--color-text-muted);
margin-top: var(--space-1);
}
/* ==========================================================================
SALES CHART SECTION
========================================================================== */
.chart-card {
background-color: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-5);
}
[data-theme="industrial"] .chart-card {
box-shadow: var(--shadow-sm);
}
[data-theme="modern"] .chart-card {
box-shadow: var(--shadow-md);
}
.chart-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-5);
flex-wrap: wrap;
gap: var(--space-3);
}
.period-selector {
display: flex;
gap: var(--space-1);
background-color: var(--color-surface-2);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
padding: 3px;
}
.period-btn {
padding: var(--space-1) var(--space-3);
border-radius: var(--radius-sm);
border: none;
font-family: var(--font-body);
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
cursor: pointer;
background: transparent;
color: var(--color-text-muted);
transition: var(--transition-fast);
letter-spacing: var(--tracking-wide);
}
.period-btn.active {
background-color: var(--color-primary);
color: var(--color-text-inverse);
}
.period-btn:not(.active):hover {
color: var(--color-text-primary);
background-color: var(--color-surface-3);
}
/* Bar chart */
.bar-chart {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: var(--space-2);
height: 140px;
padding-bottom: var(--space-6);
position: relative;
}
/* Horizontal grid lines */
.bar-chart::before {
content: '';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: var(--space-6);
background-image:
linear-gradient(to bottom,
var(--color-border) 1px,
transparent 1px,
transparent 33%,
var(--color-border) 33%,
transparent 34%,
transparent 66%,
var(--color-border) 66%,
transparent 67%
);
pointer-events: none;
}
.bar-chart__col {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-2);
min-width: 0;
position: relative;
height: 100%;
justify-content: flex-end;
}
.bar-chart__bar-wrap {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: center;
flex: 1;
}
.bar-chart__bar {
width: 70%;
max-width: 36px;
background-color: var(--color-primary);
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
opacity: 0.85;
transition: opacity var(--transition-fast), transform var(--transition-fast);
cursor: pointer;
position: relative;
}
.bar-chart__bar.today {
opacity: 1;
box-shadow: 0 0 12px rgba(0,0,0,0.3);
}
.bar-chart__bar:hover {
opacity: 1;
transform: scaleX(1.1);
}
/* Tooltip on hover */
.bar-chart__bar::after {
content: attr(data-value);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background-color: var(--color-surface-3);
color: var(--color-text-primary);
font-size: 10px;
font-family: var(--font-mono);
padding: 3px var(--space-2);
border-radius: var(--radius-sm);
white-space: nowrap;
opacity: 0;
pointer-events: none;
margin-bottom: 4px;
border: 1px solid var(--color-border);
transition: opacity var(--transition-fast);
}
.bar-chart__bar:hover::after {
opacity: 1;
}
.bar-chart__label {
font-size: 11px;
color: var(--color-text-muted);
font-weight: var(--font-weight-semibold);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
position: absolute;
bottom: 0;
}
.chart-legend {
display: flex;
gap: var(--space-5);
margin-top: var(--space-3);
flex-wrap: wrap;
}
.legend-item {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-caption);
color: var(--color-text-muted);
}
.legend-dot {
width: 8px;
height: 8px;
border-radius: var(--radius-full);
background-color: var(--color-primary);
flex-shrink: 0;
}
.legend-dot--success {
background-color: var(--color-success);
}
/* ==========================================================================
TWO-COLUMN SECTION (Top Productos / Top Clientes)
========================================================================== */
.two-col-grid {
display: grid;
grid-template-columns: 1fr;
gap: var(--space-4);
}
.rank-card {
background-color: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-5);
}
[data-theme="industrial"] .rank-card {
box-shadow: var(--shadow-sm);
}
[data-theme="modern"] .rank-card {
box-shadow: var(--shadow-md);
}
.rank-list {
display: flex;
flex-direction: column;
gap: var(--space-1);
}
.rank-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-3);
border-radius: var(--radius-md);
transition: var(--transition-fast);
}
.rank-item:hover {
background-color: var(--color-surface-2);
}
.rank-num {
width: 22px;
height: 22px;
border-radius: var(--radius-full);
background-color: var(--color-surface-3);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: var(--font-weight-bold);
color: var(--color-text-muted);
flex-shrink: 0;
}
.rank-num--1 {
background-color: rgba(234, 179, 8, 0.2);
color: var(--color-warning);
}
.rank-num--2 {
background-color: var(--color-surface-3);
color: var(--color-text-secondary);
}
.rank-item__info {
flex: 1;
min-width: 0;
}
.rank-item__name {
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.rank-item__sub {
font-size: var(--text-caption);
color: var(--color-text-muted);
margin-top: 1px;
}
.rank-item__value {
font-family: var(--font-mono);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-bold);
color: var(--color-primary);
flex-shrink: 0;
text-align: right;
}
.rank-item__bar-bg {
position: relative;
height: 3px;
background-color: var(--color-surface-3);
border-radius: var(--radius-full);
margin-top: var(--space-1);
overflow: hidden;
}
.rank-item__bar-fill {
position: absolute;
left: 0;
top: 0;
height: 100%;
background-color: var(--color-primary);
border-radius: var(--radius-full);
opacity: 0.6;
}
/* ==========================================================================
ALERTS SECTION
========================================================================== */
.alerts-grid {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
.alert-item {
display: flex;
align-items: flex-start;
gap: var(--space-4);
padding: var(--space-4);
background-color: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
transition: var(--transition-fast);
}
.alert-item:hover {
border-color: var(--color-border-strong);
}
.alert-item--error {
border-left: 4px solid var(--color-error);
}
.alert-item--warning {
border-left: 4px solid var(--color-warning);
}
.alert-item--orange {
border-left: 4px solid var(--color-primary);
}
.alert-badge {
flex-shrink: 0;
min-width: 24px;
height: 24px;
padding: 0 var(--space-2);
border-radius: var(--radius-full);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: var(--font-weight-bold);
letter-spacing: var(--tracking-wide);
}
.alert-badge--error {
background-color: rgba(239, 68, 68, 0.15);
color: var(--color-error);
}
.alert-badge--warning {
background-color: rgba(234, 179, 8, 0.15);
color: var(--color-warning);
}
.alert-badge--orange {
background-color: var(--color-primary-muted);
color: var(--color-primary);
}
.alert-icon-wrap {
width: 36px;
height: 36px;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.alert-icon-wrap--error {
background-color: rgba(239, 68, 68, 0.1);
color: var(--color-error);
}
.alert-icon-wrap--warning {
background-color: rgba(234, 179, 8, 0.1);
color: var(--color-warning);
}
.alert-icon-wrap--orange {
background-color: var(--color-primary-muted);
color: var(--color-primary);
}
.alert-content {
flex: 1;
min-width: 0;
}
.alert-title {
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
}
.alert-desc {
font-size: var(--text-caption);
color: var(--color-text-muted);
margin-top: 2px;
}
.alert-action {
font-size: var(--text-caption);
color: var(--color-primary);
font-weight: var(--font-weight-semibold);
cursor: pointer;
white-space: nowrap;
flex-shrink: 0;
align-self: center;
padding: var(--space-1) var(--space-3);
border: 1px solid var(--color-border-accent);
border-radius: var(--radius-sm);
transition: var(--transition-fast);
}
.alert-action:hover {
background-color: var(--color-primary-muted);
}
/* ==========================================================================
RECENT SALES TABLE
========================================================================== */
.table-card {
background-color: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
overflow: hidden;
}
[data-theme="industrial"] .table-card {
box-shadow: var(--shadow-sm);
}
[data-theme="modern"] .table-card {
box-shadow: var(--shadow-md);
}
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--color-border);
}
.table-wrap {
overflow-x: auto;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
table {
width: 100%;
border-collapse: collapse;
font-size: var(--text-body-sm);
min-width: 520px;
}
thead {
background-color: var(--color-surface-2);
}
th {
padding: var(--space-3) var(--space-5);
text-align: left;
font-size: 11px;
font-weight: var(--font-weight-bold);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
color: var(--color-text-muted);
white-space: nowrap;
}
td {
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--color-border);
color: var(--color-text-secondary);
vertical-align: middle;
}
tr:last-child td {
border-bottom: none;
}
tr:hover td {
background-color: var(--color-surface-1);
}
.td-mono {
font-family: var(--font-mono);
color: var(--color-text-primary);
font-weight: var(--font-weight-semibold);
}
.td-time {
font-family: var(--font-mono);
font-size: var(--text-caption);
color: var(--color-text-muted);
}
.td-client {
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
}
.td-products {
font-size: var(--text-caption);
color: var(--color-text-muted);
max-width: 180px;
}
.pago-badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px var(--space-3);
border-radius: var(--radius-full);
font-size: 10px;
font-weight: var(--font-weight-bold);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.pago-badge--efectivo {
background-color: rgba(34, 197, 94, 0.12);
color: var(--color-success);
}
.pago-badge--tarjeta {
background-color: rgba(99, 102, 241, 0.12);
color: #818cf8;
}
.pago-badge--transferencia {
background-color: rgba(234, 179, 8, 0.12);
color: var(--color-warning);
}
.pago-badge--credito {
background-color: var(--color-primary-muted);
color: var(--color-primary);
}
/* ==========================================================================
MOBILE — Hamburger Menu & Responsive
========================================================================== */
@media (max-width: 767px) {
.sidebar {
transform: translateX(-100%);
}
.sidebar.open {
transform: translateX(0);
box-shadow: var(--shadow-xl);
}
.sidebar-overlay.open {
display: block;
}
.main {
margin-left: 0;
}
.hamburger-btn {
display: flex;
}
.header__store-badge {
display: none;
}
.dashboard {
padding: var(--space-4);
gap: var(--space-5);
}
.kpi-card__value {
font-size: 1.25rem;
}
.header {
padding: var(--space-3) var(--space-4);
}
}
@media (min-width: 768px) {
.two-col-grid {
grid-template-columns: 1fr 1fr;
}
.alerts-grid {
display: grid;
grid-template-columns: 1fr;
}
}
@media (min-width: 1024px) {
.kpi-grid {
grid-template-columns: repeat(4, 1fr);
}
.alerts-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@media (min-width: 1280px) {
.dashboard {
padding: var(--space-8);
gap: var(--space-8);
}
}
/* ==========================================================================
SVG ICONS — Inline utility
========================================================================== */
svg {
display: block;
}
</style>
</head>
<body>
<!-- =========================================================================
THEME SWITCHER BAR (fixed top, 36px)
========================================================================= -->
<div class="theme-bar">
<span class="theme-bar__brand">Nexus Autoparts</span>
<div class="theme-bar__controls">
<span class="theme-bar__label">Tema:</span>
<div class="theme-switcher">
<button class="theme-btn active" id="btn-industrial" onclick="setTheme('industrial')">Industrial</button>
<button class="theme-btn" id="btn-modern" onclick="setTheme('modern')">Moderno</button>
</div>
</div>
</div>
<!-- Sidebar mobile overlay -->
<div class="sidebar-overlay" id="sidebar-overlay" onclick="closeSidebar()"></div>
<!-- =========================================================================
APP SHELL
========================================================================= -->
<div class="app-shell">
<!-- ===================================================================
SIDEBAR NAVIGATION
=================================================================== -->
<nav class="sidebar themed-scrollbar" id="sidebar">
<div class="sidebar__logo">
<div class="sidebar__logo-text">Nexus</div>
<div class="sidebar__logo-sub">Autoparts POS</div>
</div>
<div class="sidebar__nav">
<div class="sidebar__section-label">Principal</div>
<a href="/pos/dashboard" class="nav-link active">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect x="1" y="1" width="6" height="6" rx="1" fill="currentColor" opacity="0.9"/>
<rect x="9" y="1" width="6" height="6" rx="1" fill="currentColor" opacity="0.5"/>
<rect x="1" y="9" width="6" height="6" rx="1" fill="currentColor" opacity="0.5"/>
<rect x="9" y="9" width="6" height="6" rx="1" fill="currentColor" opacity="0.5"/>
</svg>
</span>
Dashboard
</a>
<a href="/pos/sale" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect x="1" y="2" width="14" height="10" rx="1.5" stroke="currentColor" stroke-width="1.5"/>
<path d="M5 15h6M8 12v3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<rect x="4" y="5" width="3" height="2" rx="0.5" fill="currentColor" opacity="0.6"/>
<rect x="9" y="5" width="3" height="2" rx="0.5" fill="currentColor" opacity="0.6"/>
</svg>
</span>
POS
</a>
<a href="/pos/catalog" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M3 2h7l3 3v9H3V2z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
<path d="M10 2v3h3" stroke="currentColor" stroke-width="1.5"/>
<path d="M5 7h6M5 9.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
</span>
Catálogo
</a>
<a href="/pos/inventory" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect x="1" y="3" width="14" height="10" rx="1.5" stroke="currentColor" stroke-width="1.5"/>
<path d="M1 6h14" stroke="currentColor" stroke-width="1.2"/>
<path d="M4 9.5h3M10 9.5h2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
</span>
Inventario
</a>
<div class="sidebar__section-label">Ventas</div>
<a href="/pos/customers" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<circle cx="7" cy="6" r="4" stroke="currentColor" stroke-width="1.5"/>
<path d="M10.5 10.5L14 14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</span>
Clientes
</a>
<a href="/pos/invoicing" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M3 2h10a1 1 0 011 1v10a1 1 0 01-1 1H3a1 1 0 01-1-1V3a1 1 0 011-1z" stroke="currentColor" stroke-width="1.5"/>
<path d="M5 6h6M5 8.5h4M5 11h2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
</span>
Facturación
</a>
<a href="/pos/accounting" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M8 1v14M11 4H6.5a2.5 2.5 0 000 5H9.5a2.5 2.5 0 010 5H4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</span>
Contabilidad
</a>
<div class="sidebar__section-label">Análisis</div>
<a href="/pos/reports" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M2 13L5 9l3 2 3-5 3 3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 13h12" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
</span>
Reportes
</a>
<div class="sidebar__section-label">Gestión</div>
<a href="/pos/marketplace" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M1 3h14v2l-1.5 1.5V14H2.5V6.5L1 5V3z" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
<path d="M6 10h4v4H6z" fill="currentColor" opacity="0.4"/>
</svg>
</span>
Marketplace B2B
</a>
<div class="sidebar__section-label">Sistema</div>
<a href="/pos/config" class="nav-link">
<span class="nav-link__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<circle cx="8" cy="8" r="2" stroke="currentColor" stroke-width="1.4"/>
<path d="M8 1v2M8 13v2M1 8h2M13 8h2M2.93 2.93l1.41 1.41M11.66 11.66l1.41 1.41M2.93 13.07l1.41-1.41M11.66 4.34l1.41-1.41" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
</span>
Configuración
</a>
</div><!-- end sidebar__nav -->
<div class="sidebar__footer">
<div class="user-chip">
<div class="user-chip__avatar">CA</div>
<div class="user-chip__info">
<div class="user-chip__name">Carlos Alvarado</div>
<div class="user-chip__role">Propietario</div>
</div>
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" style="color:var(--color-text-muted);flex-shrink:0">
<path d="M2 5l5 5 5-5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</div>
</nav><!-- end sidebar -->
<!-- ===================================================================
MAIN AREA
=================================================================== -->
<div class="main">
<!-- Header bar -->
<header class="header">
<div class="header__left">
<button class="hamburger-btn" id="hamburger-btn" onclick="toggleSidebar()" aria-label="Menú">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M2 4h14M2 9h14M2 14h14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
</svg>
</button>
<div class="header__greeting">
<div class="header__title" id="header-greeting">Buenos días</div>
<div class="header__subtitle" id="header-subtitle">Cargando...</div>
</div>
</div>
<div class="header__right">
<div class="header__store-badge">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
<path d="M1 5.5L6 1l5 4.5V11H8V8H4v3H1V5.5z" fill="currentColor" opacity="0.7"/>
</svg>
Sucursal Centro
</div>
<button class="icon-btn" title="Notificaciones" onclick="window.location.href='/pos/inventory#alertas'">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M8 1a5 5 0 00-5 5v3l-1.5 2h13L13 9V6a5 5 0 00-5-5z" stroke="currentColor" stroke-width="1.4"/>
<path d="M6.5 13a1.5 1.5 0 003 0" stroke="currentColor" stroke-width="1.4"/>
</svg>
<span class="notif-dot"></span>
</button>
<button class="icon-btn" title="Refrescar datos" onclick="Dashboard.init()">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M13.5 8a5.5 5.5 0 11-1.5-3.8" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
<path d="M14 2v4h-4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
</header>
<!-- Dashboard scrollable content -->
<div class="dashboard themed-scrollbar">
<!-- =================================================================
KPI CARDS (2x2 mobile, 4x1 desktop)
================================================================= -->
<section>
<div class="section-header">
<span class="section-title">Resumen del día</span>
<a href="/pos/reports" class="section-action" style="text-decoration:none;color:inherit;">Ver detalle &rarr;</a>
</div>
<div class="kpi-grid">
<!-- Card 1: Ventas Hoy -->
<div class="kpi-card" id="kpi-ventas-hoy">
<div class="kpi-card__accent-bar"></div>
<div class="kpi-card__label">
Ventas Hoy
<span class="kpi-card__icon">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
<path d="M7 1v12M10 4H5.5a2.5 2.5 0 000 5H8.5a2.5 2.5 0 010 5H3" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
</span>
</div>
<div class="kpi-card__value" id="kpi-ventas-total">--</div>
<div class="kpi-card__meta" id="kpi-ventas-meta">
<span class="kpi-tag kpi-tag--neutral">Cargando...</span>
</div>
</div>
<!-- Card 2: Tickets Hoy -->
<div class="kpi-card" id="kpi-tickets">
<div class="kpi-card__accent-bar"></div>
<div class="kpi-card__label">
Tickets Hoy
<span class="kpi-card__icon">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
<path d="M2 2h10a1 1 0 011 1v8a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1z" stroke="currentColor" stroke-width="1.4"/>
<path d="M3.5 5.5h7M3.5 7.5h5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
</span>
</div>
<div class="kpi-card__value" id="kpi-tickets-count">--</div>
<div class="kpi-card__meta" id="kpi-tickets-meta">
<span class="kpi-tag kpi-tag--neutral">Cargando...</span>
</div>
</div>
<!-- Card 3: Ticket Promedio -->
<div class="kpi-card" id="kpi-promedio">
<div class="kpi-card__accent-bar"></div>
<div class="kpi-card__label">
Ticket Promedio
<span class="kpi-card__icon">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
<rect x="1" y="2" width="12" height="11" rx="1.5" stroke="currentColor" stroke-width="1.4"/>
<path d="M4 1v2M10 1v2M1 6h12" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
</span>
</div>
<div class="kpi-card__value" id="kpi-promedio-value">--</div>
<div class="kpi-card__meta" id="kpi-promedio-meta">
<span class="kpi-tag kpi-tag--neutral">Cargando...</span>
</div>
</div>
<!-- Card 4: Cajas Activas -->
<div class="kpi-card" id="kpi-cajas">
<div class="kpi-card__accent-bar"></div>
<div class="kpi-card__label">
Cajas del Día
<span class="kpi-card__icon">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
<path d="M2 11L5 8l2.5 2L10 5l2.5 2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</span>
</div>
<div class="kpi-card__value" id="kpi-cajas-count">--</div>
<div class="kpi-card__meta" id="kpi-cajas-meta">
<span class="kpi-tag kpi-tag--neutral">Cargando...</span>
</div>
</div>
</div><!-- end kpi-grid -->
</section>
<!-- =================================================================
SALES CHART (CSS-only bar chart)
================================================================= -->
<section>
<div class="chart-card">
<div class="chart-header">
<div>
<div class="section-title">Ventas Semanales</div>
<div style="font-size:var(--text-caption);color:var(--color-text-muted);margin-top:2px;" id="chart-week-total">
Total semana: <strong style="color:var(--color-primary);font-family:var(--font-mono);">--</strong>
</div>
</div>
<div class="period-selector">
<button class="period-btn" onclick="setPeriod(this)">Hoy</button>
<button class="period-btn active" onclick="setPeriod(this)">Semana</button>
<button class="period-btn" onclick="setPeriod(this)">Mes</button>
<button class="period-btn" onclick="setPeriod(this)">Año</button>
</div>
</div>
<!-- Bar chart: populated by JS -->
<div class="bar-chart" id="bar-chart">
<!-- Filled dynamically -->
</div>
<div class="chart-legend" id="chart-legend">
<div class="legend-item">
<div class="legend-dot"></div>
Ventas brutas (7 días)
</div>
</div>
</div><!-- end chart-card -->
</section>
<!-- =================================================================
TOP PRODUCTOS / TOP CLIENTES
================================================================= -->
<section>
<div class="section-header">
<span class="section-title">Rankings</span>
</div>
<div class="two-col-grid">
<!-- Top Productos -->
<div class="rank-card">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
<div style="font-family:var(--font-heading);font-weight:var(--heading-weight-secondary);font-size:var(--text-body-sm);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-text-secondary);">
Top Productos Hoy
</div>
<a href="/pos/inventory" style="font-size:var(--text-caption);color:var(--color-primary);font-weight:var(--font-weight-semibold);cursor:pointer;text-decoration:none;">Ver todos</a>
</div>
<div class="rank-list" id="top-products-list">
<div class="rank-item" style="justify-content:center;color:var(--color-text-muted);font-size:var(--text-caption);">Cargando...</div>
</div>
</div><!-- end Top Productos -->
<!-- Desglose por Caja -->
<div class="rank-card">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
<div style="font-family:var(--font-heading);font-weight:var(--heading-weight-secondary);font-size:var(--text-body-sm);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-text-secondary);">
Cajas del Día
</div>
<a href="/pos/config" style="font-size:var(--text-caption);color:var(--color-primary);font-weight:var(--font-weight-semibold);cursor:pointer;text-decoration:none;">Gestionar</a>
</div>
<div class="rank-list" id="registers-list">
<div class="rank-item" style="justify-content:center;color:var(--color-text-muted);font-size:var(--text-caption);">Cargando...</div>
</div>
</div><!-- end Cajas del Día -->
</div><!-- end two-col-grid -->
</section>
<!-- =================================================================
ALERTS
================================================================= -->
<section>
<div class="section-header">
<span class="section-title">Alertas &amp; Pendientes</span>
<span class="section-action">Gestionar todo &rarr;</span>
</div>
<div class="alerts-grid" id="alerts-grid">
<div class="alert-item" style="justify-content:center;color:var(--color-text-muted);font-size:var(--text-caption);border-left:none;">Cargando alertas...</div>
</div><!-- end alerts-grid -->
</section>
<!-- =================================================================
RECENT SALES TABLE
================================================================= -->
<section style="padding-bottom: var(--space-8);">
<div class="table-card">
<div class="table-header">
<div>
<div class="section-title">Ventas Recientes</div>
<div style="font-size:var(--text-caption);color:var(--color-text-muted);margin-top:2px;">Últimas 5 transacciones</div>
</div>
<div style="display:flex;gap:var(--space-3);align-items:center;">
<div style="font-size:var(--text-caption);color:var(--color-text-muted);">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" style="display:inline;vertical-align:middle;margin-right:4px;">
<circle cx="6" cy="6" r="4" stroke="currentColor" stroke-width="1.4"/>
<circle cx="6" cy="6" r="1.5" fill="currentColor" class="pulse-dot"/>
</svg>
En vivo
</div>
<a href="/pos/reports" class="section-action" style="margin:0;text-decoration:none;color:inherit;">Ver historial &rarr;</a>
</div>
</div>
<div class="table-wrap themed-scrollbar">
<table>
<thead>
<tr>
<th>Hora</th>
<th>Cliente</th>
<th>Productos</th>
<th>Total</th>
<th>Método Pago</th>
</tr>
</thead>
<tbody id="recent-sales-tbody">
<tr><td colspan="5" style="text-align:center;color:var(--color-text-muted);font-size:var(--text-caption);">Cargando ventas recientes...</td></tr>
</tbody>
</table>
</div>
</div>
</section>
</div><!-- end dashboard -->
</div><!-- end main -->
</div><!-- end app-shell -->
<script src="/pos/static/js/i18n.js"></script>
<script src="/pos/static/js/app-init.js"></script>
<script src="/pos/static/js/pos-utils.js"></script>
<script src="/pos/static/js/sidebar.js"></script>
<script src="/pos/static/js/dashboard.js"></script>
<script src="/pos/static/js/sync-engine.js"></script>
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>
</body>
</html>