Files
Autoparts-DB/pos/templates/reports.html
consultoria-as c1d0638b45 feat(pos): add multi-language i18n (#37) and multi-currency USD/MXN (#38)
- i18n.js with 130+ translation keys for es/en, loaded in all 11 templates
- sidebar.js uses t() for all nav labels, adds MX/US language toggle
- app-init.js role labels use i18n
- currency.py service with convert() and format_currency()
- config.py adds DEFAULT_CURRENCY and EXCHANGE_RATE_USD_MXN settings
- config_bp.py adds GET/PUT /pos/api/config/currency endpoints
- config.html adds currency/exchange-rate section (Section 8)
- config.js adds loadCurrency/saveCurrency with localStorage sync
- pos.js fmt() reads pos_currency from localStorage for USD/MXN display

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

1858 lines
52 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>Reportes — Nexus Autoparts POS</title>
<link rel="stylesheet" href="/pos/static/css/tokens.css" />
<link rel="manifest" href="/pos/static/pwa/manifest.json" />
<meta name="theme-color" content="#F5A623" />
<style>
/* =========================================================================
BASE RESET & SHELL
========================================================================= */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
body {
font-family: var(--font-body);
font-size: var(--text-body);
color: var(--color-text-primary);
background-color: var(--color-bg-base);
transition: background-color var(--duration-normal) var(--ease-in-out),
color var(--duration-normal) var(--ease-in-out);
overflow: hidden;
}
[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);
}
/* =========================================================================
THEME SWITCHER BAR (fixed, 36px)
========================================================================= */
.theme-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: var(--z-toast);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-5);
background: var(--color-bg-overlay);
border-bottom: 1px solid var(--color-border);
backdrop-filter: blur(8px);
height: 36px;
flex-shrink: 0;
}
[data-theme="industrial"] .theme-bar {
background: #111111;
border-bottom-color: var(--color-primary-muted);
}
.theme-bar__left {
display: flex;
align-items: center;
gap: var(--space-3);
}
.theme-bar__brand {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: 0.75rem;
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
color: var(--color-text-accent);
}
.theme-bar__sep {
width: 1px;
height: 16px;
background: var(--color-border);
}
.theme-bar__page {
font-size: var(--text-caption);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.theme-bar__right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.theme-bar__label {
font-size: var(--text-caption);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.theme-switcher {
display: flex;
align-items: center;
background: var(--color-surface-1);
border: 1px solid var(--color-border);
border-radius: var(--radius-full);
padding: 2px;
gap: 2px;
}
.theme-btn {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 3px var(--space-3);
border: none;
border-radius: var(--radius-full);
background: transparent;
color: var(--color-text-muted);
font-family: var(--font-body);
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
cursor: pointer;
transition: var(--transition-fast);
}
.theme-btn:hover {
color: var(--color-text-primary);
}
.theme-btn.is-active {
background: var(--color-primary);
color: var(--color-text-inverse);
box-shadow: var(--shadow-sm);
}
[data-theme="industrial"] .theme-btn.is-active {
color: #000;
}
/* =========================================================================
APP SHELL
========================================================================= */
.app-shell {
display: flex;
height: 100vh;
padding-top: 36px;
}
/* =========================================================================
SIDEBAR (~220px)
========================================================================= */
.sidebar {
width: 260px;
flex-shrink: 0;
display: flex;
flex-direction: column;
background: var(--color-bg-elevated);
border-right: 1px solid var(--color-border);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
transition: var(--transition-normal);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.sidebar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
/* Brand */
.sidebar__brand {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-4) var(--space-4) var(--space-3);
border-bottom: 1px solid var(--color-border);
flex-shrink: 0;
}
.brand-logo {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
background: var(--color-primary);
color: var(--color-text-inverse);
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: 1.2rem;
letter-spacing: var(--tracking-tight);
flex-shrink: 0;
}
[data-theme="industrial"] .brand-logo {
clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}
[data-theme="modern"] .brand-logo {
border-radius: var(--radius-md);
}
.brand-name__primary {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: 0.95rem;
letter-spacing: var(--tracking-wide);
color: var(--color-text-primary);
text-transform: uppercase;
line-height: 1;
}
.brand-name__sub {
font-size: var(--text-caption);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
margin-top: 2px;
}
/* Nav */
.sidebar__nav {
flex: 1;
padding: var(--space-2) 0;
}
.nav-section-label {
padding: var(--space-3) var(--space-4) var(--space-1);
font-size: 0.65rem;
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
}
.nav-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-2) var(--space-4);
color: var(--color-text-secondary);
font-family: var(--font-body);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-regular);
text-decoration: none;
cursor: pointer;
border: none;
background: none;
width: 100%;
text-align: left;
transition: var(--transition-fast);
border-left: 3px solid transparent;
}
.nav-item:hover {
background: var(--color-primary-muted);
color: var(--color-text-primary);
border-left-color: var(--color-primary);
}
.nav-item.is-active {
background: var(--color-primary-muted);
color: var(--color-primary);
font-weight: var(--font-weight-semibold);
border-left-color: var(--color-primary);
}
.nav-item__icon {
width: 16px;
height: 16px;
opacity: 0.7;
flex-shrink: 0;
}
.nav-item.is-active .nav-item__icon,
.nav-item:hover .nav-item__icon {
opacity: 1;
}
/* Profile */
.sidebar__profile {
padding: var(--space-3) var(--space-4);
border-top: 1px solid var(--color-border);
display: flex;
align-items: center;
gap: var(--space-3);
flex-shrink: 0;
}
.profile-avatar {
width: 32px;
height: 32px;
background: var(--color-primary);
color: var(--color-text-inverse);
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: 0.8rem;
flex-shrink: 0;
}
[data-theme="industrial"] .profile-avatar {
clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
[data-theme="modern"] .profile-avatar {
border-radius: var(--radius-full);
}
.profile-info__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;
}
.profile-info__role {
font-size: var(--text-caption);
color: var(--color-text-muted);
}
/* =========================================================================
MAIN CONTENT
========================================================================= */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-width: 0;
}
/* Header */
.content-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-6);
background: var(--color-bg-elevated);
border-bottom: 1px solid var(--color-border);
flex-shrink: 0;
gap: var(--space-4);
}
[data-theme="industrial"] .content-header {
background: var(--color-surface-1);
}
.content-header__title-block {
display: flex;
flex-direction: column;
gap: 2px;
}
.content-header__eyebrow {
font-size: var(--text-caption);
color: var(--color-text-muted);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
}
.content-header__title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: var(--text-h4);
letter-spacing: var(--heading-tracking-h4);
color: var(--color-text-primary);
line-height: 1.2;
}
[data-theme="industrial"] .content-header__title {
text-transform: uppercase;
}
.content-header__actions {
display: flex;
align-items: center;
gap: var(--space-2);
flex-shrink: 0;
}
/* Scrollable body */
.content-body {
flex: 1;
overflow-y: auto;
padding: var(--space-5) var(--space-6);
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.content-body::-webkit-scrollbar { width: 6px; }
.content-body::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.content-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
.content-body::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
/* =========================================================================
BUTTONS
========================================================================= */
.btn {
display: inline-flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-4);
border: 1px solid transparent;
border-radius: var(--radius-md);
font-family: var(--font-body);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
cursor: pointer;
transition: var(--transition-fast);
white-space: nowrap;
text-decoration: none;
}
[data-theme="industrial"] .btn {
border-radius: 0;
}
.btn-primary {
background: var(--btn-primary-bg);
color: var(--btn-primary-text);
border-color: var(--btn-primary-border);
}
.btn-primary:hover {
background: var(--btn-primary-bg-hover);
}
.btn-secondary {
background: var(--btn-secondary-bg);
color: var(--btn-secondary-text);
border-color: var(--btn-secondary-border);
}
.btn-secondary:hover {
background: var(--btn-secondary-bg-hover);
}
.btn-ghost {
background: var(--btn-ghost-bg);
color: var(--btn-ghost-text);
border-color: var(--btn-ghost-border);
}
.btn-ghost:hover {
background: var(--color-primary-muted);
color: var(--color-primary);
border-color: var(--color-primary);
}
.btn-sm {
padding: var(--space-1) var(--space-3);
font-size: var(--text-caption);
}
.btn svg {
width: 14px;
height: 14px;
}
/* =========================================================================
TAB NAV
========================================================================= */
.tab-nav {
display: flex;
align-items: flex-end;
gap: 0;
border-bottom: 2px solid var(--color-border);
margin-bottom: var(--space-5);
}
.tab-btn {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-3) var(--space-5);
border: none;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
background: transparent;
color: var(--color-text-muted);
font-family: var(--font-body);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
cursor: pointer;
transition: var(--transition-fast);
white-space: nowrap;
letter-spacing: var(--tracking-wide);
}
.tab-btn svg {
width: 15px;
height: 15px;
opacity: 0.7;
}
.tab-btn:hover {
color: var(--color-text-primary);
background: var(--color-primary-muted);
}
.tab-btn.is-active {
color: var(--color-primary);
border-bottom-color: var(--color-primary);
}
.tab-btn.is-active svg {
opacity: 1;
}
/* Tab panels */
.tab-panel {
display: none;
}
.tab-panel.is-active {
display: block;
}
/* =========================================================================
FILTER BAR
========================================================================= */
.filter-bar {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
background: var(--color-surface-1);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
margin-bottom: var(--space-5);
flex-wrap: wrap;
}
[data-theme="industrial"] .filter-bar {
border-radius: 0;
border-left: 3px solid var(--color-primary);
}
.filter-bar__label {
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
white-space: nowrap;
}
.filter-input,
.filter-select {
padding: var(--space-2) var(--space-3);
background: var(--color-bg-overlay);
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
color: var(--color-text-primary);
font-family: var(--font-body);
font-size: var(--text-body-sm);
outline: none;
transition: var(--transition-fast);
}
[data-theme="industrial"] .filter-input,
[data-theme="industrial"] .filter-select {
border-radius: 0;
}
.filter-input:focus,
.filter-select:focus {
border-color: var(--color-border-focus);
box-shadow: var(--shadow-focus);
}
.filter-input[type="date"] {
color-scheme: dark;
}
[data-theme="modern"] .filter-input[type="date"] {
color-scheme: light;
}
.filter-sep {
color: var(--color-text-muted);
font-size: var(--text-caption);
}
.filter-bar__spacer {
flex: 1;
}
/* =========================================================================
KPI CARDS GRID
========================================================================= */
.kpi-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-4);
margin-bottom: var(--space-5);
}
@media (max-width: 1024px) {
.kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
.kpi-grid { grid-template-columns: 1fr; }
}
.kpi-card {
background: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-4) var(--space-5);
display: flex;
flex-direction: column;
gap: var(--space-1);
position: relative;
overflow: hidden;
transition: var(--transition-fast);
}
[data-theme="industrial"] .kpi-card {
border-radius: 0;
border-top: 2px solid var(--color-primary);
}
[data-theme="modern"] .kpi-card {
box-shadow: var(--shadow-sm);
}
.kpi-card:hover {
border-color: var(--color-border-accent);
box-shadow: var(--shadow-md);
}
[data-theme="industrial"] .kpi-card:hover {
border-top-color: var(--color-primary);
}
.kpi-card__icon {
position: absolute;
top: var(--space-3);
right: var(--space-4);
width: 32px;
height: 32px;
background: var(--color-primary-muted);
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
color: var(--color-primary);
}
.kpi-card__icon svg {
width: 16px;
height: 16px;
}
.kpi-card__label {
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
}
.kpi-card__value {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: var(--text-h4);
color: var(--color-text-primary);
line-height: 1.1;
}
.kpi-card__sub {
font-size: var(--text-caption);
color: var(--color-text-muted);
display: flex;
align-items: center;
gap: var(--space-1);
margin-top: var(--space-1);
}
.kpi-card__delta {
display: inline-flex;
align-items: center;
gap: 2px;
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
padding: 1px 6px;
border-radius: var(--radius-full);
}
.kpi-card__delta--up {
background: var(--color-success-light);
color: var(--color-success-dark);
}
[data-theme="industrial"] .kpi-card__delta--up {
background: rgba(34, 197, 94, 0.15);
color: var(--color-success);
}
.kpi-card__delta--down {
background: var(--color-error-light);
color: var(--color-error-dark);
}
[data-theme="industrial"] .kpi-card__delta--down {
background: rgba(239, 68, 68, 0.15);
color: var(--color-error);
}
/* =========================================================================
SECTION HEADER
========================================================================= */
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-3);
gap: var(--space-3);
}
.section-title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-secondary);
font-size: var(--text-h6);
color: var(--color-text-primary);
letter-spacing: var(--heading-tracking-h6);
text-transform: uppercase;
}
[data-theme="industrial"] .section-title {
color: var(--color-primary);
letter-spacing: var(--tracking-wider);
}
.section-actions {
display: flex;
align-items: center;
gap: var(--space-2);
}
/* =========================================================================
CSS BAR CHART
========================================================================= */
.bar-chart-card {
background: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-4) var(--space-5);
margin-bottom: var(--space-5);
}
[data-theme="industrial"] .bar-chart-card {
border-radius: 0;
border-left: 3px solid var(--color-primary);
}
[data-theme="modern"] .bar-chart-card {
box-shadow: var(--shadow-sm);
}
.bar-chart-card__title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-secondary);
font-size: var(--text-body-sm);
color: var(--color-text-primary);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
margin-bottom: var(--space-4);
}
[data-theme="industrial"] .bar-chart-card__title {
color: var(--color-text-accent);
}
.bar-chart {
display: flex;
align-items: flex-end;
gap: var(--space-3);
height: 140px;
}
.bar-chart__col {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
flex: 1;
height: 100%;
justify-content: flex-end;
}
.bar-chart__bar-wrap {
flex: 1;
width: 100%;
display: flex;
align-items: flex-end;
}
.bar-chart__bar {
width: 100%;
background: var(--color-primary);
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
transition: opacity var(--duration-fast) var(--ease-in-out);
position: relative;
min-height: 4px;
}
[data-theme="industrial"] .bar-chart__bar {
border-radius: 0;
clip-path: polygon(0 6px, 6px 0, 100% 0, 100% 100%, 0 100%);
}
.bar-chart__bar:hover {
opacity: 0.8;
}
.bar-chart__bar-val {
position: absolute;
top: -18px;
left: 50%;
transform: translateX(-50%);
font-size: 0.6rem;
font-weight: var(--font-weight-bold);
color: var(--color-text-accent);
white-space: nowrap;
}
.bar-chart__day {
font-size: 0.65rem;
color: var(--color-text-muted);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
white-space: nowrap;
}
/* =========================================================================
DATA TABLES
========================================================================= */
.table-card {
background: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
overflow: hidden;
margin-bottom: var(--space-5);
}
[data-theme="industrial"] .table-card {
border-radius: 0;
}
[data-theme="modern"] .table-card {
box-shadow: var(--shadow-sm);
}
.table-card__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-3) var(--space-5);
border-bottom: 1px solid var(--color-border);
background: var(--color-surface-2);
gap: var(--space-3);
}
[data-theme="industrial"] .table-card__header {
background: var(--color-surface-3);
}
.table-card__title {
font-family: var(--font-heading);
font-weight: var(--heading-weight-secondary);
font-size: var(--text-body-sm);
color: var(--color-text-primary);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
}
[data-theme="industrial"] .table-card__title {
color: var(--color-text-accent);
}
.table-wrap {
overflow-x: auto;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: var(--text-body-sm);
}
.data-table thead {
background: var(--color-surface-1);
}
[data-theme="industrial"] .data-table thead {
background: var(--color-surface-2);
}
.data-table th {
padding: var(--space-2) var(--space-4);
text-align: left;
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
white-space: nowrap;
border-bottom: 1px solid var(--color-border);
}
.data-table th.align-right,
.data-table td.align-right {
text-align: right;
}
.data-table th.align-center,
.data-table td.align-center {
text-align: center;
}
.data-table td {
padding: var(--space-3) var(--space-4);
color: var(--color-text-secondary);
border-bottom: 1px solid var(--color-border);
vertical-align: middle;
}
.data-table tr:last-child td {
border-bottom: none;
}
.data-table tbody tr {
transition: background var(--duration-fast) var(--ease-in-out);
}
.data-table tbody tr:hover {
background: var(--color-primary-muted);
}
.td-strong {
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
}
.td-mono {
font-family: var(--font-mono);
font-size: var(--text-body-sm);
color: var(--color-text-primary);
}
.td-mono-accent {
font-family: var(--font-mono);
font-size: var(--text-body-sm);
color: var(--color-text-accent);
font-weight: var(--font-weight-bold);
}
/* Rank badge */
.rank-badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
background: var(--color-primary-muted);
color: var(--color-primary);
font-size: var(--text-caption);
font-weight: var(--font-weight-bold);
border-radius: var(--radius-sm);
}
[data-theme="industrial"] .rank-badge {
border-radius: 0;
}
.rank-badge--gold {
background: rgba(234, 179, 8, 0.15);
color: var(--color-warning);
}
/* Progress bar inline */
.progress-mini {
display: flex;
align-items: center;
gap: var(--space-2);
}
.progress-mini__bar {
flex: 1;
height: 4px;
background: var(--color-border);
border-radius: var(--radius-full);
overflow: hidden;
min-width: 60px;
}
.progress-mini__fill {
height: 100%;
background: var(--color-primary);
border-radius: var(--radius-full);
}
.progress-mini__pct {
font-size: var(--text-caption);
color: var(--color-text-muted);
white-space: nowrap;
min-width: 32px;
text-align: right;
}
/* Status pills */
.pill {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 2px var(--space-2);
border-radius: var(--radius-full);
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
white-space: nowrap;
}
.pill--warning {
background: rgba(234, 179, 8, 0.15);
color: var(--color-warning);
}
.pill--error {
background: rgba(239, 68, 68, 0.15);
color: var(--color-error);
}
.pill--success {
background: rgba(34, 197, 94, 0.15);
color: var(--color-success);
}
.pill--muted {
background: var(--color-surface-3);
color: var(--color-text-muted);
}
.pill--dot::before {
content: '';
width: 6px;
height: 6px;
border-radius: var(--radius-full);
background: currentColor;
flex-shrink: 0;
}
/* Export button group */
.export-group {
display: flex;
align-items: center;
gap: var(--space-2);
padding-top: var(--space-2);
}
.export-label {
font-size: var(--text-caption);
color: var(--color-text-muted);
font-weight: var(--font-weight-semibold);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
/* =========================================================================
AGING TABLE (Financieros)
========================================================================= */
.aging-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-4);
margin-bottom: var(--space-5);
}
@media (max-width: 768px) {
.aging-grid { grid-template-columns: repeat(2, 1fr); }
}
.aging-card {
background: var(--color-bg-elevated);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: var(--space-4);
text-align: center;
transition: var(--transition-fast);
}
[data-theme="industrial"] .aging-card {
border-radius: 0;
}
[data-theme="modern"] .aging-card {
box-shadow: var(--shadow-sm);
}
.aging-card:hover {
border-color: var(--color-border-accent);
}
.aging-card__range {
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
margin-bottom: var(--space-2);
}
.aging-card__amount {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: var(--text-h5);
color: var(--color-text-primary);
margin-bottom: var(--space-1);
}
.aging-card__count {
font-size: var(--text-caption);
color: var(--color-text-muted);
}
.aging-card__bar {
height: 4px;
border-radius: var(--radius-full);
margin-top: var(--space-3);
}
.aging-card--ok .aging-card__bar { background: var(--color-success); }
.aging-card--warn .aging-card__bar { background: var(--color-warning); }
.aging-card--danger .aging-card__bar { background: var(--color-error); }
.aging-card--critical .aging-card__bar { background: #991b1b; }
/* =========================================================================
CASH FLOW SUMMARY
========================================================================= */
.cashflow-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
margin-bottom: var(--space-5);
}
@media (max-width: 768px) {
.cashflow-grid { grid-template-columns: 1fr; }
}
.cashflow-card {
background: 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-2);
}
[data-theme="industrial"] .cashflow-card {
border-radius: 0;
}
[data-theme="modern"] .cashflow-card {
box-shadow: var(--shadow-sm);
}
.cashflow-card--inflow {
border-top: 3px solid var(--color-success);
}
.cashflow-card--outflow {
border-top: 3px solid var(--color-error);
}
.cashflow-card--net {
border-top: 3px solid var(--color-primary);
}
.cashflow-card__label {
font-size: var(--text-caption);
font-weight: var(--font-weight-semibold);
color: var(--color-text-muted);
letter-spacing: var(--tracking-widest);
text-transform: uppercase;
}
.cashflow-card__value {
font-family: var(--font-heading);
font-weight: var(--heading-weight-primary);
font-size: var(--text-h4);
}
.cashflow-card--inflow .cashflow-card__value { color: var(--color-success); }
.cashflow-card--outflow .cashflow-card__value { color: var(--color-error); }
.cashflow-card--net .cashflow-card__value { color: var(--color-primary); }
.cashflow-card__items {
list-style: none;
margin-top: var(--space-2);
display: flex;
flex-direction: column;
gap: var(--space-1);
}
.cashflow-card__item {
display: flex;
justify-content: space-between;
font-size: var(--text-caption);
color: var(--color-text-secondary);
padding-top: var(--space-1);
border-top: 1px solid var(--color-border);
}
.cashflow-card__item-val {
font-weight: var(--font-weight-semibold);
font-family: var(--font-mono);
}
/* =========================================================================
TWO-COLUMN LAYOUT HELPER
========================================================================= */
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-4);
}
@media (max-width: 900px) {
.two-col { grid-template-columns: 1fr; }
}
/* =========================================================================
PAYMENT METHOD BARS
========================================================================= */
.pay-method-row {
display: flex;
align-items: center;
gap: var(--space-4);
margin-bottom: var(--space-4);
}
.pay-method-row:last-child {
margin-bottom: 0;
}
.pay-method__label {
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-secondary);
min-width: 110px;
white-space: nowrap;
}
.pay-method__bar-wrap {
flex: 1;
height: 10px;
background: var(--color-border);
border-radius: var(--radius-full);
overflow: hidden;
}
[data-theme="industrial"] .pay-method__bar-wrap {
border-radius: 0;
}
.pay-method__bar {
height: 100%;
background: var(--color-primary);
border-radius: var(--radius-full);
transition: width 0.6s var(--ease-in-out);
}
[data-theme="industrial"] .pay-method__bar {
border-radius: 0;
}
.pay-method__bar--b { background: var(--color-success); }
.pay-method__bar--c { background: var(--color-warning); }
.pay-method__bar--d { background: var(--color-primary-muted); border: 1px solid var(--color-primary); }
[data-theme="industrial"] .pay-method__bar--d {
background: rgba(245, 166, 35, 0.2);
}
.pay-method__val {
font-family: var(--font-mono);
font-size: var(--text-body-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
min-width: 150px;
text-align: right;
white-space: nowrap;
}
/* =========================================================================
DUAL BAR CHART (Ingresos vs Egresos)
========================================================================= */
.dual-bar-chart {
display: flex;
align-items: flex-end;
gap: var(--space-4);
height: 160px;
padding-bottom: var(--space-1);
}
.dual-bar-group {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
flex: 1;
height: 100%;
justify-content: flex-end;
}
.dual-bar-cols {
display: flex;
align-items: flex-end;
gap: 3px;
width: 100%;
flex: 1;
}
.dual-bar {
flex: 1;
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
min-height: 4px;
transition: opacity var(--duration-fast) var(--ease-in-out);
}
[data-theme="industrial"] .dual-bar {
border-radius: 0;
}
.dual-bar:hover {
opacity: 0.8;
}
.dual-bar--ingreso {
background: var(--color-success);
}
.dual-bar--egreso {
background: var(--color-error);
}
.dual-bar-group__label {
font-size: 0.65rem;
color: var(--color-text-muted);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
white-space: nowrap;
}
.dual-chart-legend {
display: flex;
gap: var(--space-4);
margin-top: var(--space-3);
margin-bottom: var(--space-4);
}
.legend-item {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-caption);
color: var(--color-text-muted);
}
.legend-dot {
width: 10px;
height: 10px;
border-radius: var(--radius-full);
flex-shrink: 0;
}
.legend-dot--ingreso { background: var(--color-success); }
.legend-dot--egreso { background: var(--color-error); }
/* =========================================================================
MARGIN HELPERS
========================================================================= */
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
/* =========================================================================
PRINT STYLES
========================================================================= */
@media print {
.theme-bar,
.sidebar,
.tab-nav,
.filter-bar,
.content-header__actions,
.export-group,
.btn {
display: none !important;
}
body {
overflow: visible !important;
font-size: 11pt;
color: #000;
background: #fff;
}
.app-shell {
display: block;
padding-top: 0;
height: auto;
}
.main-content {
overflow: visible;
height: auto;
}
.content-body {
overflow: visible;
height: auto;
padding: 0;
}
.tab-panel {
display: block !important;
}
.kpi-card,
.table-card,
.bar-chart-card {
break-inside: avoid;
border: 1px solid #ccc !important;
box-shadow: none !important;
border-radius: 0 !important;
}
.kpi-grid {
grid-template-columns: repeat(4, 1fr) !important;
}
.data-table th,
.data-table td {
border: 1px solid #ddd;
color: #000;
background: #fff !important;
}
.content-header__title {
color: #000;
font-size: 18pt;
}
@page {
margin: 1.5cm;
size: A4 landscape;
}
}
/* =========================================================================
RESPONSIVE SIDEBAR COLLAPSE
========================================================================= */
@media (max-width: 768px) {
.sidebar {
width: 56px;
}
.sidebar .brand-name,
.sidebar .nav-item span,
.sidebar .nav-section-label,
.sidebar .profile-info {
display: none;
}
.sidebar .nav-item {
justify-content: center;
padding: var(--space-3);
border-left: none;
border-bottom: 3px solid transparent;
}
.sidebar .nav-item.is-active {
border-bottom-color: var(--color-primary);
}
.sidebar__brand {
justify-content: center;
padding: var(--space-3);
}
.sidebar__profile {
justify-content: center;
}
.content-body {
padding: var(--space-4);
}
.kpi-grid {
grid-template-columns: repeat(2, 1fr);
}
}
</style>
</head>
<body>
<!-- =========================================================================
THEME SWITCHER BAR
========================================================================= -->
<div class="theme-bar">
<div class="theme-bar__left">
<span class="theme-bar__brand">Nexus Autoparts</span>
<div class="theme-bar__sep"></div>
<span class="theme-bar__page">Sucursal Norte — Mzo 2026</span>
</div>
<div class="theme-bar__right">
<span class="theme-bar__label" style="font-family:var(--font-mono)" id="live-clock">00:00:00</span>
<div class="theme-bar__sep"></div>
<span class="theme-bar__label">Tema</span>
<div class="theme-switcher">
<button class="theme-btn is-active" id="btn-industrial" onclick="setTheme('industrial')">
<svg viewBox="0 0 14 14" width="10" height="10" fill="currentColor"><rect x="1" y="1" width="12" height="12" rx="1"/></svg>
Industrial
</button>
<button class="theme-btn" id="btn-modern" onclick="setTheme('modern')">
<svg viewBox="0 0 14 14" width="10" height="10" fill="currentColor"><circle cx="7" cy="7" r="5"/></svg>
Modern
</button>
</div>
</div>
</div>
<!-- =========================================================================
APP SHELL
========================================================================= -->
<div class="app-shell">
<!-- =======================================================================
SIDEBAR
======================================================================= -->
<aside class="sidebar">
<div class="sidebar__brand">
<div class="brand-logo">NA</div>
<div class="brand-name">
<div class="brand-name__primary">Nexus / Autoparts POS</div>
</div>
</div>
<nav class="sidebar__nav">
<div class="nav-section-label">Principal</div>
<a href="/pos/dashboard" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="1" y="1" width="7" height="7" rx="1"/><rect x="10" y="1" width="7" height="7" rx="1"/>
<rect x="1" y="10" width="7" height="7" rx="1"/><rect x="10" y="10" width="7" height="7" rx="1"/>
</svg>
<span>Dashboard</span>
</a>
<a href="/pos/sale" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="1" y="3" width="16" height="12" rx="1"/><line x1="1" y1="7" x2="17" y2="7"/>
<line x1="6" y1="7" x2="6" y2="15"/>
</svg>
<span>POS</span>
</a>
<a href="/pos/catalog" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="2" y="2" width="14" height="14" rx="1"/><line x1="6" y1="6" x2="12" y2="6"/>
<line x1="6" y1="9" x2="12" y2="9"/><line x1="6" y1="12" x2="10" y2="12"/>
</svg>
<span>Catálogo</span>
</a>
<a href="/pos/inventory" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="1" y="5" width="16" height="11" rx="1"/><path d="M5 5V4a4 4 0 018 0v1"/>
<line x1="9" y1="9" x2="9" y2="12"/>
</svg>
<span>Inventario</span>
</a>
<div class="nav-section-label">Gestión</div>
<a href="/pos/customers" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<circle cx="9" cy="6" r="3"/><path d="M3 15c0-3.314 2.686-6 6-6s6 2.686 6 6"/>
</svg>
<span>Clientes</span>
</a>
<a href="/pos/invoicing" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="3" y="1" width="12" height="16" rx="1"/><line x1="6" y1="6" x2="12" y2="6"/>
<line x1="6" y1="9" x2="12" y2="9"/><line x1="6" y1="12" x2="9" y2="12"/>
</svg>
<span>Facturación</span>
</a>
<a href="/pos/accounting" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M9 2v14M2 9h14"/><circle cx="9" cy="9" r="7"/>
</svg>
<span>Contabilidad</span>
</a>
<a href="/pos/reports" class="nav-item is-active">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<rect x="1" y="1" width="16" height="16" rx="1"/>
<line x1="5" y1="13" x2="5" y2="9"/><line x1="9" y1="13" x2="9" y2="6"/>
<line x1="13" y1="13" x2="13" y2="4"/>
</svg>
<span>Reportes</span>
</a>
<div class="nav-section-label">Sistema</div>
<a href="/pos/config" class="nav-item">
<svg class="nav-item__icon" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
<circle cx="9" cy="9" r="2.5"/>
<path d="M9 1v2M9 15v2M1 9h2M15 9h2M3.22 3.22l1.42 1.42M13.36 13.36l1.42 1.42M3.22 14.78l1.42-1.42M13.36 4.64l1.42-1.42"/>
</svg>
<span>Configuración</span>
</a>
</nav>
<div class="sidebar__profile">
<div class="profile-avatar">HG</div>
<div class="profile-info">
<div class="profile-info__name">Hugo García</div>
<div class="profile-info__role">Administrador</div>
</div>
</div>
</aside>
<!-- =======================================================================
MAIN CONTENT
======================================================================= -->
<main class="main-content">
<!-- Header -->
<div class="content-header">
<div class="content-header__title-block">
<span class="content-header__eyebrow">Gestión</span>
<h1 class="content-header__title">Reportes</h1>
</div>
<div class="content-header__actions">
<button class="btn btn-ghost">
<svg viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.5" width="14" height="14">
<rect x="1" y="1" width="12" height="12" rx="1"/><line x1="4" y1="5" x2="10" y2="5"/><line x1="4" y1="8" x2="8" y2="8"/>
</svg>
Exportar Excel
</button>
<button class="btn btn-primary">
<svg viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.5" width="14" height="14">
<rect x="2" y="1" width="10" height="12" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7" x2="9" y2="7"/><line x1="5" y1="9" x2="7" y2="9"/>
</svg>
Exportar PDF
</button>
</div>
</div>
<!-- Content Body -->
<div class="content-body">
<!-- TAB NAVIGATION -->
<div class="tab-nav">
<button class="tab-btn is-active" onclick="switchTab('ventas', this)">
<svg viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4">
<path d="M1 13l3-4 3 2 3-5 4 3"/><path d="M1 1v12h13"/>
</svg>
Ventas
</button>
<button class="tab-btn" onclick="switchTab('inventario', this)">
<svg viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4">
<rect x="1" y="4" width="13" height="10" rx="1"/><path d="M4 4V3a3 3 0 016 0v1"/>
</svg>
Inventario
</button>
<button class="tab-btn" onclick="switchTab('clientes', this)">
<svg viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4">
<circle cx="7.5" cy="5" r="2.5"/><path d="M2 13c0-3 2.5-5 5.5-5s5.5 2 5.5 5"/>
</svg>
Clientes
</button>
<button class="tab-btn" onclick="switchTab('financieros', this)">
<svg viewBox="0 0 15 15" fill="none" stroke="currentColor" stroke-width="1.4">
<circle cx="7.5" cy="7.5" r="6.5"/><path d="M7.5 1.5v13M4 5h5a2 2 0 010 4H5a2 2 0 000 4h6"/>
</svg>
Financieros
</button>
</div>
<!-- ==================================================================
TAB 1: VENTAS
================================================================== -->
<div class="tab-panel is-active" id="panel-ventas">
<!-- Filter Bar -->
<div class="filter-bar">
<span class="filter-bar__label">Desde</span>
<input type="date" class="filter-input" id="ventas-date-from" />
<span class="filter-bar__label">Hasta</span>
<input type="date" class="filter-input" id="ventas-date-to" />
<div class="filter-bar__spacer"></div>
<button class="btn btn-primary btn-sm" id="btn-generar-ventas" onclick="Reports.loadVentas()">Generar</button>
</div>
<!-- KPI Cards (dynamic) -->
<div class="kpi-grid" id="ventas-kpis"></div>
<!-- Bar Chart: Ventas por día (dynamic) -->
<div class="bar-chart-card" id="ventas-bar-chart"></div>
<!-- Tables row -->
<div class="two-col">
<!-- Ventas por Vendedor -->
<div class="table-card" id="ventas-por-vendedor"></div>
<!-- Ventas por Método de Pago -->
<div class="table-card" id="ventas-por-metodo"></div>
</div>
<!-- Sales detail table -->
<div class="table-card mb-5" id="ventas-detalle"></div>
</div>
<!-- ==================================================================
TAB 2: INVENTARIO
================================================================== -->
<div class="tab-panel" id="panel-inventario">
<!-- KPI Cards (dynamic) -->
<div class="kpi-grid" id="inventario-kpis"></div>
<!-- Valorizado -->
<div class="table-card mb-5" id="inventario-valorizacion"></div>
<!-- ABC -->
<div class="table-card mb-5" id="inventario-abc"></div>
<!-- Bajo stock -->
<div class="table-card mb-5" id="inventario-low-stock"></div>
<!-- Sin Movimiento -->
<div class="table-card mb-5" id="inventario-no-movement"></div>
</div>
<!-- ==================================================================
TAB 3: CLIENTES
================================================================== -->
<div class="tab-panel" id="panel-clientes">
<!-- KPI Cards (dynamic) -->
<div class="kpi-grid" id="clientes-kpis"></div>
<!-- Aging report -->
<div class="table-card mb-5" id="clientes-aging"></div>
</div>
<!-- ==================================================================
TAB 4: FINANCIEROS
================================================================== -->
<div class="tab-panel" id="panel-financieros">
<!-- Period selector for financial reports -->
<div class="filter-bar">
<span class="filter-bar__label">Mes</span>
<select class="filter-select" id="fin-month"></select>
<span class="filter-bar__label">Anio</span>
<select class="filter-select" id="fin-year"></select>
<div class="filter-bar__spacer"></div>
<button class="btn btn-primary btn-sm" onclick="Reports.loadFinancieros()">Generar</button>
</div>
<!-- KPI Cards (dynamic) -->
<div class="kpi-grid" id="financieros-kpis"></div>
<!-- Income statement -->
<div class="table-card mb-5" id="financieros-income"></div>
<!-- Balance sheet -->
<div class="table-card mb-5" id="financieros-balance"></div>
<!-- Trial balance -->
<div class="table-card mb-5" id="financieros-trial"></div>
<!-- Cortes de caja -->
<div class="table-card mb-5" id="financieros-cortes"></div>
</div>
<!-- End panels -->
</div>
<!-- End content-body -->
</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/sidebar.js"></script>
<script src="/pos/static/js/reports.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>