<!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" />

  <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" value="2026-03-01" />
            <span class="filter-bar__label">Hasta</span>
            <input type="date" class="filter-input" value="2026-03-31" />
            <select class="filter-select">
              <option>Todas las sucursales</option>
              <option>Sucursal Norte</option>
              <option>Sucursal Sur</option>
              <option>Sucursal Centro</option>
            </select>
            <div class="filter-bar__spacer"></div>
            <button class="btn btn-primary btn-sm">Generar</button>
          </div>

          <!-- KPI Cards -->
          <div class="kpi-grid">
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 1v14M4 4h7a2 2 0 010 4H5a2 2 0 000 4h8"/></svg>
              </div>
              <div class="kpi-card__label">Total Ventas ($)</div>
              <div class="kpi-card__value">$487,320</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 12.4%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="3" width="14" height="10" rx="1"/><line x1="1" y1="7" x2="15" y2="7"/></svg>
              </div>
              <div class="kpi-card__label">Ticket Promedio ($)</div>
              <div class="kpi-card__value">$379.50</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 3.9%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="5" width="14" height="9" rx="1"/><path d="M4 5V4a4 4 0 018 0v1"/></svg>
              </div>
              <div class="kpi-card__label">Productos Vendidos</div>
              <div class="kpi-card__value">8,941</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--down">↓ 2.3%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="7"/><path d="M5 11l6-6M5 5h2v2"/></svg>
              </div>
              <div class="kpi-card__label">Margen Promedio (%)</div>
              <div class="kpi-card__value">39.6%</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 1.3pp</span>
                vs mes anterior
              </div>
            </div>
          </div>

          <!-- Bar Chart: Ventas por día -->
          <div class="bar-chart-card">
            <div class="bar-chart-card__title">Ventas por Día — Últimos 7 días</div>
            <div class="bar-chart">
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:68%">
                    <span class="bar-chart__bar-val">$14.2k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Lun</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:82%">
                    <span class="bar-chart__bar-val">$17.1k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Mar</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:55%">
                    <span class="bar-chart__bar-val">$11.5k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Mié</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:91%">
                    <span class="bar-chart__bar-val">$19.0k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Jue</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:100%">
                    <span class="bar-chart__bar-val">$20.9k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Vie</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:76%">
                    <span class="bar-chart__bar-val">$15.9k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Sáb</div>
              </div>
              <div class="bar-chart__col">
                <div class="bar-chart__bar-wrap">
                  <div class="bar-chart__bar" style="height:38%">
                    <span class="bar-chart__bar-val">$7.9k</span>
                  </div>
                </div>
                <div class="bar-chart__day">Dom</div>
              </div>
            </div>
          </div>

          <!-- Tables row -->
          <div class="two-col">
            <!-- Top 10 Productos -->
            <div class="table-card">
              <div class="table-card__header">
                <span class="table-card__title">Top 10 Productos más Vendidos</span>
              </div>
              <div class="table-wrap">
                <table class="data-table">
                  <thead>
                    <tr>
                      <th>#</th>
                      <th>Producto</th>
                      <th>SKU</th>
                      <th class="align-right">Cantidad</th>
                      <th class="align-right">Monto</th>
                      <th>% del Total</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td><span class="rank-badge rank-badge--gold">1</span></td>
                      <td class="td-strong">Filtro de aceite Bosch</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">BSC-FLT-001</td>
                      <td class="align-right td-mono">342</td>
                      <td class="align-right td-mono-accent">$18,240</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:100%"></div></div>
                          <span class="progress-mini__pct">11.8%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">2</span></td>
                      <td class="td-strong">Pastillas freno Brembo</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">BRM-PAS-204</td>
                      <td class="align-right td-mono">289</td>
                      <td class="align-right td-mono-accent">$24,565</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:85%"></div></div>
                          <span class="progress-mini__pct">10.0%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">3</span></td>
                      <td class="td-strong">Aceite Mobil 5W-30 1L</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">MOB-5W30-1L</td>
                      <td class="align-right td-mono">521</td>
                      <td class="align-right td-mono-accent">$15,630</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:73%"></div></div>
                          <span class="progress-mini__pct">8.6%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">4</span></td>
                      <td class="td-strong">Bujías NGK Iridium</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">NGK-IRI-B6</td>
                      <td class="align-right td-mono">198</td>
                      <td class="align-right td-mono-accent">$11,880</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:58%"></div></div>
                          <span class="progress-mini__pct">6.5%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">5</span></td>
                      <td class="td-strong">Batería Optima 12V</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">OPT-BAT-12V</td>
                      <td class="align-right td-mono">87</td>
                      <td class="align-right td-mono-accent">$32,190</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:49%"></div></div>
                          <span class="progress-mini__pct">5.7%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">6</span></td>
                      <td>Filtro aire K&amp;N</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">KN-AIR-33</td>
                      <td class="align-right td-mono">156</td>
                      <td class="align-right td-mono-accent">$9,360</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:44%"></div></div>
                          <span class="progress-mini__pct">5.1%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">7</span></td>
                      <td>Amortiguador Monroe</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">MON-AMO-G7</td>
                      <td class="align-right td-mono">64</td>
                      <td class="align-right td-mono-accent">$19,200</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:39%"></div></div>
                          <span class="progress-mini__pct">4.5%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">8</span></td>
                      <td>Anticongelante 50/50</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">ATC-5050-4L</td>
                      <td class="align-right td-mono">203</td>
                      <td class="align-right td-mono-accent">$8,120</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:33%"></div></div>
                          <span class="progress-mini__pct">3.9%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">9</span></td>
                      <td>Correa de distribución</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">GAT-COR-K080</td>
                      <td class="align-right td-mono">41</td>
                      <td class="align-right td-mono-accent">$14,760</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:28%"></div></div>
                          <span class="progress-mini__pct">3.2%</span>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td><span class="rank-badge">10</span></td>
                      <td>Líquido frenos DOT4</td>
                      <td class="td-mono" style="color:var(--color-text-muted)">DOT4-FRE-1L</td>
                      <td class="align-right td-mono">178</td>
                      <td class="align-right td-mono-accent">$5,340</td>
                      <td>
                        <div class="progress-mini">
                          <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:23%"></div></div>
                          <span class="progress-mini__pct">2.7%</span>
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>

            <!-- Ventas por Vendedor -->
            <div class="table-card">
              <div class="table-card__header">
                <span class="table-card__title">Ventas por Vendedor</span>
              </div>
              <div class="table-wrap">
                <table class="data-table">
                  <thead>
                    <tr>
                      <th>Vendedor</th>
                      <th class="align-right"># Ventas</th>
                      <th class="align-right">Total</th>
                      <th class="align-right">Ticket Prom.</th>
                      <th class="align-center">Estado</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <div style="display:flex;align-items:center;gap:var(--space-2)">
                          <div style="width:28px;height:28px;background:var(--color-primary);color:var(--color-text-inverse);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0;border-radius:var(--radius-full)">MR</div>
                          <span class="td-strong">María Rodríguez</span>
                        </div>
                      </td>
                      <td class="align-right td-mono">312</td>
                      <td class="align-right td-mono-accent">$128,448</td>
                      <td class="align-right td-mono">$411.69</td>
                      <td class="align-center"><span class="pill pill--success pill--dot">Activo</span></td>
                    </tr>
                    <tr>
                      <td>
                        <div style="display:flex;align-items:center;gap:var(--space-2)">
                          <div style="width:28px;height:28px;background:var(--color-surface-3);color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0;border-radius:var(--radius-full)">JL</div>
                          <span class="td-strong">Juan López</span>
                        </div>
                      </td>
                      <td class="align-right td-mono">287</td>
                      <td class="align-right td-mono-accent">$109,060</td>
                      <td class="align-right td-mono">$380.00</td>
                      <td class="align-center"><span class="pill pill--success pill--dot">Activo</span></td>
                    </tr>
                    <tr>
                      <td>
                        <div style="display:flex;align-items:center;gap:var(--space-2)">
                          <div style="width:28px;height:28px;background:var(--color-surface-3);color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0;border-radius:var(--radius-full)">AG</div>
                          <span class="td-strong">Ana Guerrero</span>
                        </div>
                      </td>
                      <td class="align-right td-mono">241</td>
                      <td class="align-right td-mono-accent">$93,990</td>
                      <td class="align-right td-mono">$390.00</td>
                      <td class="align-center"><span class="pill pill--success pill--dot">Activo</span></td>
                    </tr>
                    <tr>
                      <td>
                        <div style="display:flex;align-items:center;gap:var(--space-2)">
                          <div style="width:28px;height:28px;background:var(--color-surface-3);color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0;border-radius:var(--radius-full)">CH</div>
                          <span class="td-strong">Carlos Herrera</span>
                        </div>
                      </td>
                      <td class="align-right td-mono">198</td>
                      <td class="align-right td-mono-accent">$74,448</td>
                      <td class="align-right td-mono">$376.00</td>
                      <td class="align-center"><span class="pill pill--warning pill--dot">Licencia</span></td>
                    </tr>
                    <tr>
                      <td>
                        <div style="display:flex;align-items:center;gap:var(--space-2)">
                          <div style="width:28px;height:28px;background:var(--color-surface-3);color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;font-size:0.65rem;font-weight:700;flex-shrink:0;border-radius:var(--radius-full)">PV</div>
                          <span>Pedro Vargas</span>
                        </div>
                      </td>
                      <td class="align-right td-mono">246</td>
                      <td class="align-right td-mono-accent">$81,374</td>
                      <td class="align-right td-mono">$330.79</td>
                      <td class="align-center"><span class="pill pill--success pill--dot">Activo</span></td>
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>

          <!-- Ventas por Método de Pago -->
          <div class="section-header">
            <h3 class="section-title">Ventas por Método de Pago</h3>
          </div>
          <div class="table-card mb-5">
            <div class="table-wrap" style="padding: var(--space-4) var(--space-5);">
              <div class="pay-method-row">
                <span class="pay-method__label">Efectivo</span>
                <div class="pay-method__bar-wrap">
                  <div class="pay-method__bar" style="width:48%"></div>
                </div>
                <span class="pay-method__val">$234,114 <span style="color:var(--color-text-muted);font-weight:400">48%</span></span>
              </div>
              <div class="pay-method-row">
                <span class="pay-method__label">Tarjeta</span>
                <div class="pay-method__bar-wrap">
                  <div class="pay-method__bar pay-method__bar--b" style="width:27%"></div>
                </div>
                <span class="pay-method__val">$131,576 <span style="color:var(--color-text-muted);font-weight:400">27%</span></span>
              </div>
              <div class="pay-method-row">
                <span class="pay-method__label">Transferencia</span>
                <div class="pay-method__bar-wrap">
                  <div class="pay-method__bar pay-method__bar--c" style="width:14%"></div>
                </div>
                <span class="pay-method__val">$68,225 <span style="color:var(--color-text-muted);font-weight:400">14%</span></span>
              </div>
              <div class="pay-method-row">
                <span class="pay-method__label">Crédito</span>
                <div class="pay-method__bar-wrap">
                  <div class="pay-method__bar pay-method__bar--d" style="width:11%"></div>
                </div>
                <span class="pay-method__val">$53,605 <span style="color:var(--color-text-muted);font-weight:400">11%</span></span>
              </div>
            </div>
          </div>

        </div>

        <!-- ==================================================================
             TAB 2: INVENTARIO
             ================================================================== -->
        <div class="tab-panel" id="panel-inventario">

          <!-- KPI Cards -->
          <div class="kpi-grid">
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="5" width="14" height="9" rx="1"/><path d="M4 5V4a4 4 0 018 0v1"/></svg>
              </div>
              <div class="kpi-card__label">Valor Total Inventario ($)</div>
              <div class="kpi-card__value">$2,140,000</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 5.2%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="5" width="14" height="9" rx="1"/><path d="M4 5V4a4 4 0 018 0v1"/></svg>
              </div>
              <div class="kpi-card__label">SKUs Activos</div>
              <div class="kpi-card__value">3,847</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">+143</span>
                nuevos este mes
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 1v6l3 3"/><circle cx="8" cy="8" r="7"/></svg>
              </div>
              <div class="kpi-card__label">Rotación Promedio</div>
              <div class="kpi-card__value">4.3x</div>
              <div class="kpi-card__sub">veces / mes</div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="7"/><line x1="8" y1="5" x2="8" y2="8"/><line x1="8" y1="11" x2="8" y2="11.5" stroke-width="2"/></svg>
              </div>
              <div class="kpi-card__label">Artículos Stock Bajo</div>
              <div class="kpi-card__value">218</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--down">+34</span>
                vs mes anterior
              </div>
            </div>
          </div>

          <!-- Bajo stock -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Productos con Stock Bajo</span>
              <span class="pill pill--warning pill--dot">47 productos</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Producto</th>
                    <th class="align-right">Stock Actual</th>
                    <th class="align-right">Mínimo</th>
                    <th>Proveedor</th>
                    <th>Última Compra</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Filtro combustible Toyota Corolla</td>
                    <td class="align-right td-mono" style="color:var(--color-error)">2</td>
                    <td class="align-right td-mono">10</td>
                    <td>Distribuidora ABC</td>
                    <td style="color:var(--color-text-muted)">15/Feb/2026</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Bujía Bosch Iridium BK6MCI</td>
                    <td class="align-right td-mono" style="color:var(--color-error)">4</td>
                    <td class="align-right td-mono">20</td>
                    <td>Bosch México</td>
                    <td style="color:var(--color-text-muted)">20/Feb/2026</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Amortiguador trasero Nissan Sentra</td>
                    <td class="align-right td-mono" style="color:var(--color-warning)">6</td>
                    <td class="align-right td-mono">8</td>
                    <td>Monroe Distribución</td>
                    <td style="color:var(--color-text-muted)">10/Mar/2026</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Pastilla freno delantera VW Jetta</td>
                    <td class="align-right td-mono" style="color:var(--color-warning)">7</td>
                    <td class="align-right td-mono">12</td>
                    <td>Brembo MX</td>
                    <td style="color:var(--color-text-muted)">12/Mar/2026</td>
                  </tr>
                  <tr>
                    <td>Aceite transmisión ATF Dexron VI</td>
                    <td class="align-right td-mono" style="color:var(--color-warning)">9</td>
                    <td class="align-right td-mono">15</td>
                    <td>Castrol México</td>
                    <td style="color:var(--color-text-muted)">05/Mar/2026</td>
                  </tr>
                  <tr>
                    <td>Sensor O2 Bosch Honda Civic</td>
                    <td class="align-right td-mono" style="color:var(--color-warning)">3</td>
                    <td class="align-right td-mono">5</td>
                    <td>Bosch México</td>
                    <td style="color:var(--color-text-muted)">28/Feb/2026</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- Movimientos del Periodo -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Movimientos del Periodo</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Tipo</th>
                    <th>Producto</th>
                    <th class="align-right">Cantidad</th>
                    <th>Fecha</th>
                    <th>Usuario</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td><span class="pill pill--success">Entrada</span></td>
                    <td class="td-strong">Filtro de aceite Bosch x48</td>
                    <td class="align-right td-mono">48</td>
                    <td style="color:var(--color-text-muted)">01/Mar/2026</td>
                    <td>M. Rodríguez</td>
                  </tr>
                  <tr>
                    <td><span class="pill pill--error">Salida</span></td>
                    <td class="td-strong">Bujías NGK Iridium x12</td>
                    <td class="align-right td-mono">12</td>
                    <td style="color:var(--color-text-muted)">03/Mar/2026</td>
                    <td>J. López</td>
                  </tr>
                  <tr>
                    <td><span class="pill pill--success">Entrada</span></td>
                    <td class="td-strong">Pastillas Brembo Racing x24</td>
                    <td class="align-right td-mono">24</td>
                    <td style="color:var(--color-text-muted)">07/Mar/2026</td>
                    <td>H. García</td>
                  </tr>
                  <tr>
                    <td><span class="pill pill--error">Salida</span></td>
                    <td>Aceite Mobil 5W-30 1L x36</td>
                    <td class="align-right td-mono">36</td>
                    <td style="color:var(--color-text-muted)">10/Mar/2026</td>
                    <td>A. Guerrero</td>
                  </tr>
                  <tr>
                    <td><span class="pill pill--success">Entrada</span></td>
                    <td>Batería Optima 12V x10</td>
                    <td class="align-right td-mono">10</td>
                    <td style="color:var(--color-text-muted)">15/Mar/2026</td>
                    <td>M. Rodríguez</td>
                  </tr>
                  <tr>
                    <td><span class="pill pill--error">Salida</span></td>
                    <td>Amortiguador Monroe x8</td>
                    <td class="align-right td-mono">8</td>
                    <td style="color:var(--color-text-muted)">18/Mar/2026</td>
                    <td>C. Herrera</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- Productos Sin Movimiento -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Productos Sin Movimiento (&gt;30 días)</span>
              <span class="pill pill--muted">218 SKUs</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Producto</th>
                    <th class="align-right">Stock</th>
                    <th>Último Movimiento</th>
                    <th class="align-right">Valor</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Radiador Nissan Pathfinder 2004</td>
                    <td class="align-right td-mono">3</td>
                    <td style="color:var(--color-text-muted)">26/Nov/2025</td>
                    <td class="align-right td-mono">$5,610</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Caja dirección Honda CR-V 2001</td>
                    <td class="align-right td-mono">1</td>
                    <td style="color:var(--color-text-muted)">24/Dec/2025</td>
                    <td class="align-right td-mono">$4,800</td>
                  </tr>
                  <tr>
                    <td>Alternador Chevrolet S10 2000</td>
                    <td class="align-right td-mono">2</td>
                    <td style="color:var(--color-text-muted)">16/Jan/2026</td>
                    <td class="align-right td-mono">$3,200</td>
                  </tr>
                  <tr>
                    <td>Compresor A/C Ford Explorer 2002</td>
                    <td class="align-right td-mono">1</td>
                    <td style="color:var(--color-text-muted)">30/Jan/2026</td>
                    <td class="align-right td-mono">$6,900</td>
                  </tr>
                  <tr>
                    <td>Eje flecha Jetta A3 izq.</td>
                    <td class="align-right td-mono">4</td>
                    <td style="color:var(--color-text-muted)">14/Feb/2026</td>
                    <td class="align-right td-mono">$5,200</td>
                  </tr>
                  <tr>
                    <td>Bomba agua Seat Ibiza 1.6</td>
                    <td class="align-right td-mono">2</td>
                    <td style="color:var(--color-text-muted)">28/Feb/2026</td>
                    <td class="align-right td-mono">$1,640</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

        </div>

        <!-- ==================================================================
             TAB 3: CLIENTES
             ================================================================== -->
        <div class="tab-panel" id="panel-clientes">

          <!-- KPI Cards -->
          <div class="kpi-grid">
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="6" cy="5" r="2.5"/><path d="M1 13c0-2.76 2.24-5 5-5s5 2.24 5 5"/><circle cx="12" cy="5" r="2"/><path d="M12 9c1.66 0 3 1.34 3 3"/></svg>
              </div>
              <div class="kpi-card__label">Clientes Activos</div>
              <div class="kpi-card__value">4,210</div>
              <div class="kpi-card__sub">registros activos</div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="6.5"/><line x1="8" y1="5" x2="8" y2="11"/><line x1="5" y1="8" x2="11" y2="8"/></svg>
              </div>
              <div class="kpi-card__label">Nuevos del Mes</div>
              <div class="kpi-card__value">143</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 18.3%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="3" width="14" height="10" rx="1"/><line x1="1" y1="7" x2="15" y2="7"/></svg>
              </div>
              <div class="kpi-card__label">Clientes con Crédito</div>
              <div class="kpi-card__value">892</div>
              <div class="kpi-card__sub">líneas activas</div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 1v14M4 4h7a2 2 0 010 4H5a2 2 0 000 4h8"/></svg>
              </div>
              <div class="kpi-card__label">Saldo Total Créditos ($)</div>
              <div class="kpi-card__value">$249,510</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--down">↑ 4.2%</span>
                vs mes anterior
              </div>
            </div>
          </div>

          <!-- Top 10 Clientes por Compras -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Top 10 Clientes por Compras</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Cliente</th>
                    <th>RFC</th>
                    <th class="align-right">Compras</th>
                    <th class="align-right">Monto Total</th>
                    <th>Última Compra</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Taller Mecánico El Rápido</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">TME840312HX4</td>
                    <td class="align-right td-mono">48</td>
                    <td class="align-right td-mono-accent">$42,890</td>
                    <td>31 Mar 2026</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Autoservicio García Hnos.</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">AGH920518KL9</td>
                    <td class="align-right td-mono">39</td>
                    <td class="align-right td-mono-accent">$38,120</td>
                    <td>30 Mar 2026</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Flota Transporte Noreste SA</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">FTN010628AB3</td>
                    <td class="align-right td-mono">27</td>
                    <td class="align-right td-mono-accent">$89,430</td>
                    <td>25 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Roberto Mendoza Torres</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">METR780904QJ2</td>
                    <td class="align-right td-mono">31</td>
                    <td class="align-right td-mono-accent">$24,560</td>
                    <td>28 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Refaccionaria El Centro</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">REC851107MN5</td>
                    <td class="align-right td-mono">22</td>
                    <td class="align-right td-mono-accent">$31,080</td>
                    <td>29 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Miguel Ángel Ríos</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">RIMA771215FP7</td>
                    <td class="align-right td-mono">24</td>
                    <td class="align-right td-mono-accent">$18,320</td>
                    <td>27 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Servicio Express Monterrey</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">SEM960430DX1</td>
                    <td class="align-right td-mono">18</td>
                    <td class="align-right td-mono-accent">$22,140</td>
                    <td>26 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Distribuidora Xóchitl S.A.</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">DXS030811CR4</td>
                    <td class="align-right td-mono">15</td>
                    <td class="align-right td-mono-accent">$27,600</td>
                    <td>18 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Laura Sánchez Pérez</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">SAPL820612RH8</td>
                    <td class="align-right td-mono">19</td>
                    <td class="align-right td-mono-accent">$14,250</td>
                    <td>20 Mar 2026</td>
                  </tr>
                  <tr>
                    <td>Arturo Vega Castillo</td>
                    <td class="td-mono" style="color:var(--color-text-muted)">VECA790318GK6</td>
                    <td class="align-right td-mono">17</td>
                    <td class="align-right td-mono-accent">$11,900</td>
                    <td>22 Mar 2026</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- Clientes con Saldo Pendiente -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Clientes con Saldo Pendiente</span>
              <span class="pill pill--error pill--dot">12 clientes</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Cliente</th>
                    <th class="align-right">Crédito Autorizado</th>
                    <th class="align-right">Saldo</th>
                    <th>Vencimiento</th>
                    <th class="align-center">Estado</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Taller Moreno e Hijos</td>
                    <td class="align-right td-mono">$25,000</td>
                    <td class="align-right td-mono-accent">$18,400</td>
                    <td style="color:var(--color-error)">28 Dic 2025</td>
                    <td class="align-center"><span class="pill pill--error">Vencido</span></td>
                  </tr>
                  <tr>
                    <td class="td-strong">Servicio López Automóviles</td>
                    <td class="align-right td-mono">$15,000</td>
                    <td class="align-right td-mono-accent">$9,750</td>
                    <td style="color:var(--color-error)">23 Ene 2026</td>
                    <td class="align-center"><span class="pill pill--error">Vencido</span></td>
                  </tr>
                  <tr>
                    <td>Ricardo Castro N.</td>
                    <td class="align-right td-mono">$8,000</td>
                    <td class="align-right td-mono-accent">$4,200</td>
                    <td style="color:var(--color-warning)">15 Feb 2026</td>
                    <td class="align-center"><span class="pill pill--warning">Por vencer</span></td>
                  </tr>
                  <tr>
                    <td>Autoelectrónica Ramos</td>
                    <td class="align-right td-mono">$12,000</td>
                    <td class="align-right td-mono-accent">$6,890</td>
                    <td style="color:var(--color-warning)">22 Feb 2026</td>
                    <td class="align-center"><span class="pill pill--warning">Por vencer</span></td>
                  </tr>
                  <tr>
                    <td>Grupo Autopartes del Sur</td>
                    <td class="align-right td-mono">$20,000</td>
                    <td class="align-right td-mono-accent">$12,300</td>
                    <td>30 Mar 2026</td>
                    <td class="align-center"><span class="pill pill--success">Vigente</span></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

          <!-- Clientes Nuevos del Mes -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Clientes Nuevos del Mes</span>
              <span class="pill pill--success pill--dot">143 este mes</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Nombre</th>
                    <th>Fecha Alta</th>
                    <th class="align-right">Compras</th>
                    <th class="align-center">Tipo</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Ernesto Jiménez Soto</td>
                    <td>31 Mar 2026</td>
                    <td class="align-right td-mono-accent">$1,240</td>
                    <td class="align-center"><span class="pill pill--muted">Mostrador</span></td>
                  </tr>
                  <tr>
                    <td class="td-strong">Taller Veloz S.A.</td>
                    <td>30 Mar 2026</td>
                    <td class="align-right td-mono-accent">$4,890</td>
                    <td class="align-center"><span class="pill pill--success">Taller</span></td>
                  </tr>
                  <tr>
                    <td>Patricia Núñez Domínguez</td>
                    <td>28 Mar 2026</td>
                    <td class="align-right td-mono-accent">$680</td>
                    <td class="align-center"><span class="pill pill--muted">Mostrador</span></td>
                  </tr>
                  <tr>
                    <td>Flotilla Logística MX</td>
                    <td>27 Mar 2026</td>
                    <td class="align-right td-mono-accent">$12,430</td>
                    <td class="align-center"><span class="pill pill--success">Taller</span></td>
                  </tr>
                  <tr>
                    <td>Francisco Serrano V.</td>
                    <td>25 Mar 2026</td>
                    <td class="align-right td-mono-accent">$920</td>
                    <td class="align-center"><span class="pill pill--muted">Mostrador</span></td>
                  </tr>
                  <tr>
                    <td>Electro-Auto Precisión</td>
                    <td>24 Mar 2026</td>
                    <td class="align-right td-mono-accent">$3,400</td>
                    <td class="align-center"><span class="pill pill--success">Taller</span></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

        </div>

        <!-- ==================================================================
             TAB 4: FINANCIEROS
             ================================================================== -->
        <div class="tab-panel" id="panel-financieros">

          <!-- KPI Cards -->
          <div class="kpi-grid">
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M1 13l3-4 3 2 3-5 4 3"/><path d="M1 1v12h13"/></svg>
              </div>
              <div class="kpi-card__label">Ingresos ($)</div>
              <div class="kpi-card__value">$487,320</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 12.4%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="7"/><line x1="5" y1="8" x2="11" y2="8"/></svg>
              </div>
              <div class="kpi-card__label">Egresos ($)</div>
              <div class="kpi-card__value">$294,180</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--down">↑ 9.8%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 1v14M4 4h7a2 2 0 010 4H5a2 2 0 000 4h8"/></svg>
              </div>
              <div class="kpi-card__label">Utilidad ($)</div>
              <div class="kpi-card__value">$193,140</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 16.2%</span>
                vs mes anterior
              </div>
            </div>
            <div class="kpi-card">
              <div class="kpi-card__icon">
                <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="7"/><path d="M5 11l6-6M5 5h2v2"/></svg>
              </div>
              <div class="kpi-card__label">Margen (%)</div>
              <div class="kpi-card__value">39.6%</div>
              <div class="kpi-card__sub">
                <span class="kpi-card__delta kpi-card__delta--up">↑ 1.3pp</span>
                vs mes anterior
              </div>
            </div>
          </div>

          <!-- Ingresos vs Egresos chart (6 months) -->
          <div class="bar-chart-card">
            <div class="bar-chart-card__title">Ingresos vs Egresos — Últimos 6 Meses</div>
            <div class="dual-chart-legend">
              <div class="legend-item"><div class="legend-dot legend-dot--ingreso"></div> Ingresos</div>
              <div class="legend-item"><div class="legend-dot legend-dot--egreso"></div> Egresos</div>
            </div>
            <div class="dual-bar-chart">
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:82%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:71%"></div>
                </div>
                <div class="dual-bar-group__label">Oct</div>
              </div>
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:75%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:66%"></div>
                </div>
                <div class="dual-bar-group__label">Nov</div>
              </div>
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:91%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:78%"></div>
                </div>
                <div class="dual-bar-group__label">Dic</div>
              </div>
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:82%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:69%"></div>
                </div>
                <div class="dual-bar-group__label">Ene</div>
              </div>
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:89%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:74%"></div>
                </div>
                <div class="dual-bar-group__label">Feb</div>
              </div>
              <div class="dual-bar-group">
                <div class="dual-bar-cols">
                  <div class="dual-bar dual-bar--ingreso" style="height:100%"></div>
                  <div class="dual-bar dual-bar--egreso" style="height:84%"></div>
                </div>
                <div class="dual-bar-group__label">Mar</div>
              </div>
            </div>
          </div>

          <!-- Desglose de Gastos -->
          <div class="section-header">
            <h3 class="section-title">Desglose de Gastos</h3>
          </div>
          <div class="table-card mb-5">
            <div class="table-wrap" style="padding: var(--space-5);">
              <div style="display:grid;grid-template-columns:1fr 1fr;gap:var(--space-6)">
                <div>
                  <table class="data-table" style="margin-bottom:0">
                    <thead>
                      <tr>
                        <th>Categoría</th>
                        <th class="align-right">Monto</th>
                        <th>% del Total</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td class="td-strong">Compra de mercancía</td>
                        <td class="align-right td-mono-accent">$157,840</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:100%"></div></div>
                            <span class="progress-mini__pct">53.6%</span>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td class="td-strong">Nómina</td>
                        <td class="align-right td-mono-accent">$89,400</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:57%"></div></div>
                            <span class="progress-mini__pct">30.4%</span>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>Renta y servicios</td>
                        <td class="align-right td-mono">$28,100</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:18%"></div></div>
                            <span class="progress-mini__pct">9.5%</span>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>Impuestos y contribuciones</td>
                        <td class="align-right td-mono">$14,640</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:9%"></div></div>
                            <span class="progress-mini__pct">4.9%</span>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>Logística y transporte</td>
                        <td class="align-right td-mono">$4,200</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:3%"></div></div>
                            <span class="progress-mini__pct">1.4%</span>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>Otros</td>
                        <td class="align-right td-mono">$200</td>
                        <td>
                          <div class="progress-mini">
                            <div class="progress-mini__bar"><div class="progress-mini__fill" style="width:0.5%"></div></div>
                            <span class="progress-mini__pct">0.1%</span>
                          </div>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </div>
                <div>
                  <div style="font-size:var(--text-caption);color:var(--color-text-muted);text-transform:uppercase;letter-spacing:var(--tracking-widest);font-weight:var(--font-weight-semibold);margin-bottom:var(--space-3)">Total Egresos del Periodo</div>
                  <div style="font-family:var(--font-heading);font-size:var(--text-h3);font-weight:var(--heading-weight-primary);color:var(--color-text-primary);margin-bottom:var(--space-2)">$294,180</div>
                  <div style="font-size:var(--text-body-sm);color:var(--color-text-muted);margin-bottom:var(--space-5)">Marzo 2026</div>
                  <div style="display:flex;flex-direction:column;gap:var(--space-3)">
                    <div style="display:flex;justify-content:space-between;font-size:var(--text-caption)">
                      <span style="color:var(--color-text-muted)">Mayor gasto:</span>
                      <span style="font-weight:var(--font-weight-semibold)">Compra mercancía</span>
                    </div>
                    <div style="display:flex;justify-content:space-between;font-size:var(--text-caption)">
                      <span style="color:var(--color-text-muted)">% sobre ventas:</span>
                      <span style="font-weight:var(--font-weight-semibold);color:var(--color-primary)">60.4%</span>
                    </div>
                    <div style="display:flex;justify-content:space-between;font-size:var(--text-caption)">
                      <span style="color:var(--color-text-muted)">vs mes anterior:</span>
                      <span style="font-weight:var(--font-weight-semibold);color:var(--color-error)">↑ 9.8%</span>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- Flujo de Efectivo Semanal -->
          <div class="table-card mb-5">
            <div class="table-card__header">
              <span class="table-card__title">Flujo de Efectivo Semanal — Marzo 2026</span>
            </div>
            <div class="table-wrap">
              <table class="data-table">
                <thead>
                  <tr>
                    <th>Semana</th>
                    <th class="align-right">Ingresos</th>
                    <th class="align-right">Egresos</th>
                    <th class="align-right">Neto</th>
                    <th class="align-right">Acumulado</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td class="td-strong">Semana 1 (01–07 Mar)</td>
                    <td class="align-right td-mono">$98,240</td>
                    <td class="align-right td-mono">$61,800</td>
                    <td class="align-right td-mono-accent">$36,440</td>
                    <td class="align-right" style="font-family:var(--font-mono);font-weight:700;color:var(--color-primary)">$36,440</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Semana 2 (08–14 Mar)</td>
                    <td class="align-right td-mono">$124,560</td>
                    <td class="align-right td-mono">$74,200</td>
                    <td class="align-right td-mono-accent">$50,360</td>
                    <td class="align-right" style="font-family:var(--font-mono);font-weight:700;color:var(--color-primary)">$86,800</td>
                  </tr>
                  <tr>
                    <td class="td-strong">Semana 3 (15–21 Mar)</td>
                    <td class="align-right td-mono">$132,890</td>
                    <td class="align-right td-mono">$82,640</td>
                    <td class="align-right td-mono-accent">$50,250</td>
                    <td class="align-right" style="font-family:var(--font-mono);font-weight:700;color:var(--color-primary)">$137,050</td>
                  </tr>
                  <tr style="background: var(--color-primary-muted);">
                    <td class="td-strong" style="color:var(--color-primary)">Semana 4 (22–31 Mar)</td>
                    <td class="align-right td-mono">$131,630</td>
                    <td class="align-right td-mono">$75,540</td>
                    <td class="align-right td-mono-accent">$56,090</td>
                    <td class="align-right" style="font-family:var(--font-mono);font-weight:700;color:var(--color-primary)">$193,140</td>
                  </tr>
                  <tr>
                    <td style="color:var(--color-text-muted)">Total Marzo 2026</td>
                    <td class="align-right td-mono" style="font-weight:700">$487,320</td>
                    <td class="align-right td-mono" style="font-weight:700">$294,180</td>
                    <td class="align-right td-mono-accent" style="font-weight:700">$193,140</td>
                    <td class="align-right" style="font-family:var(--font-mono);font-weight:700;color:var(--color-success)">$193,140</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>

        </div>
        <!-- End panels -->

      </div>
      <!-- End content-body -->

    </main>
  </div>
  <!-- End app-shell -->

  <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>

</body>
</html>
