<!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>Diagramas — Nexus Autoparts POS</title>
  <link rel="stylesheet" href="/pos/static/css/tokens.css" />
  <link rel="stylesheet" href="/pos/static/css/pos-glass.css" />
  <link rel="stylesheet" href="/pos/static/css/chat.css" />
  <link rel="stylesheet" href="/pos/static/css/onboarding.css" />
  <link rel="manifest" href="/pos/static/pwa/manifest.json" />
  <meta name="theme-color" content="#F5A623" />
  <script src="/pos/static/js/native-bridge.js"></script>

  <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-image: radial-gradient(circle, var(--dot-grid-color) 1px, transparent 1px);
      background-size: var(--dot-grid-size) var(--dot-grid-size);
    }

    /* =========================================================================
       APP LAYOUT
       ========================================================================= */

    .app-shell { display: flex; height: 100vh; padding-top: 36px; }

    /* =========================================================================
       SIDEBAR (shared pattern)
       ========================================================================= */

    .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; transition: var(--transition-normal);
    }
    .sidebar__brand {
      display: flex; align-items: center; gap: var(--space-3);
      padding: var(--space-5) var(--space-5) var(--space-4);
      border-bottom: 1px solid var(--color-border); flex-shrink: 0;
    }
    .brand-logo {
      width: 40px; height: 40px; 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.375rem; letter-spacing: var(--tracking-tight); flex-shrink: 0;
    }
    [data-theme="industrial"] .brand-logo { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); border-radius: 0; }
    [data-theme="modern"] .brand-logo { border-radius: var(--radius-md); }
    .brand-name { display: flex; flex-direction: column; line-height: 1; }
    .brand-name__primary { font-family: var(--font-heading); font-weight: var(--heading-weight-primary); font-size: 1.125rem; letter-spacing: var(--tracking-wide); color: var(--color-text-primary); text-transform: uppercase; }
    .brand-name__sub { font-family: var(--font-body); font-size: var(--text-caption); color: var(--color-text-muted); letter-spacing: var(--tracking-wider); text-transform: uppercase; margin-top: 2px; }

    .sidebar__nav { flex: 1; padding: var(--space-3) 0; }
    .nav-section-label { padding: var(--space-3) var(--space-5) var(--space-1); font-size: var(--text-caption); font-family: var(--font-body); 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-5); 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); }
    [data-theme="industrial"] .nav-item.is-active { background: rgba(245, 166, 35, 0.12); }
    .nav-item__icon { width: 18px; height: 18px; opacity: 0.75; flex-shrink: 0; }
    .nav-item.is-active .nav-item__icon, .nav-item:hover .nav-item__icon { opacity: 1; }

    .sidebar__profile { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
    .profile-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--color-primary-muted); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: var(--font-weight-bold); font-size: var(--text-body-sm); flex-shrink: 0; }
    .profile-info { overflow: hidden; }
    .profile-info__name { font-weight: var(--font-weight-semibold); font-size: var(--text-body-sm); 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;
    }

    .page-header {
      display: flex; align-items: center; gap: var(--space-4);
      padding: var(--space-4) var(--space-5);
      border-bottom: 1px solid var(--color-border);
      background: var(--color-bg-elevated);
      flex-shrink: 0;
    }

    .page-header__title {
      font-family: var(--font-heading); font-weight: var(--heading-weight-primary);
      font-size: 1.25rem; color: var(--color-text-primary);
    }

    .page-header__filter {
      margin-left: auto;
      padding: var(--space-2) var(--space-3);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      background: var(--color-bg-base);
      color: var(--color-text-primary);
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
      min-width: 220px;
      outline: none;
      transition: var(--transition-fast);
    }
    .page-header__filter:focus {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 2px var(--color-primary-muted);
    }

    .page-body {
      flex: 1; overflow-y: auto; padding: var(--space-5);
    }

    /* =========================================================================
       LOADING & EMPTY
       ========================================================================= */

    .loading {
      display: none; align-items: center; justify-content: center;
      padding: var(--space-8); flex: 1;
    }
    .spinner {
      width: 40px; height: 40px; border: 3px solid var(--color-border);
      border-top-color: var(--color-primary); border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    .empty-state {
      display: none; flex-direction: column; align-items: center;
      justify-content: center; gap: var(--space-3); padding: var(--space-8);
      color: var(--color-text-muted); text-align: center;
    }
    .empty-state__title { font-weight: var(--font-weight-semibold); font-size: 1.1rem; }
    .empty-state__subtitle { font-size: var(--text-body-sm); }

    /* =========================================================================
       DIAGRAM LIST VIEW
       ========================================================================= */

    .diagram-category { margin-bottom: var(--space-6); }

    .category-title {
      font-family: var(--font-heading);
      font-weight: var(--heading-weight-primary);
      font-size: 1rem;
      color: var(--color-text-primary);
      text-transform: uppercase;
      letter-spacing: var(--tracking-wide);
      padding-bottom: var(--space-2);
      border-bottom: 2px solid var(--color-primary);
      margin-bottom: var(--space-4);
    }

    .diagram-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: var(--space-4);
    }

    .diagram-card {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      cursor: pointer;
      transition: var(--transition-fast);
    }
    .diagram-card:hover {
      border-color: var(--color-primary);
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }
    [data-theme="industrial"] .diagram-card {
      border-radius: var(--radius-sm);
    }

    .diagram-card__preview {
      width: 100%;
      height: 180px;
      background: #f8f8f8;
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
      border-bottom: 1px solid var(--color-border);
    }
    [data-theme="modern"] .diagram-card__preview {
      background: var(--color-bg-base);
    }
    .diagram-card__preview img {
      width: 100%; height: 100%;
      object-fit: contain;
      padding: var(--space-3);
    }

    .diagram-card__info {
      padding: var(--space-3) var(--space-4);
    }
    .diagram-card__name {
      font-weight: var(--font-weight-semibold);
      font-size: var(--text-body-sm);
      color: var(--color-text-primary);
      margin-bottom: 2px;
    }
    .diagram-card__group {
      font-size: var(--text-caption);
      color: var(--color-text-muted);
    }

    /* =========================================================================
       DIAGRAM VIEWER
       ========================================================================= */

    .diagram-viewer {
      display: none; flex: 1; flex-direction: row; overflow: hidden;
    }

    .viewer-main {
      flex: 1; display: flex; flex-direction: column; overflow: hidden;
      min-width: 0;
    }

    .viewer-toolbar {
      display: flex; align-items: center; gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      border-bottom: 1px solid var(--color-border);
      background: var(--color-bg-elevated);
      flex-shrink: 0;
    }

    .viewer-toolbar .btn-icon {
      width: 36px; height: 36px;
      display: flex; align-items: center; justify-content: center;
      background: var(--color-bg-base); border: 1px solid var(--color-border);
      border-radius: var(--radius-md); cursor: pointer;
      color: var(--color-text-secondary);
      transition: var(--transition-fast);
    }
    .viewer-toolbar .btn-icon:hover {
      background: var(--color-primary-muted);
      color: var(--color-primary);
      border-color: var(--color-primary);
    }

    .viewer-toolbar__title {
      font-family: var(--font-heading);
      font-weight: var(--heading-weight-primary);
      font-size: 1rem;
      color: var(--color-text-primary);
      flex: 1;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    .zoom-controls {
      display: flex; gap: var(--space-1); margin-left: auto;
    }

    .svg-container {
      flex: 1; overflow: hidden; position: relative;
      background: var(--color-bg-base);
      cursor: grab;
    }
    .svg-container:active { cursor: grabbing; }

    .svg-wrapper {
      width: 100%; height: 100%;
      transform-origin: center center;
      transition: none;
      display: flex; align-items: center; justify-content: center;
    }
    .svg-wrapper svg {
      max-width: 100%; max-height: 100%;
    }

    .svg-loading, .svg-error {
      color: var(--color-text-muted);
      font-size: var(--text-body);
      padding: var(--space-6);
    }

    /* ---- Parts list sidebar ---- */
    .parts-sidebar {
      width: 280px; flex-shrink: 0;
      background: var(--color-bg-elevated);
      border-left: 1px solid var(--color-border);
      overflow-y: auto;
      display: flex; flex-direction: column;
    }

    .parts-list__title {
      padding: var(--space-4);
      font-family: var(--font-heading);
      font-weight: var(--heading-weight-primary);
      font-size: var(--text-body-sm);
      text-transform: uppercase;
      letter-spacing: var(--tracking-wide);
      color: var(--color-text-muted);
      border-bottom: 1px solid var(--color-border);
    }

    .part-item {
      display: flex; align-items: center; gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      cursor: pointer; border-bottom: 1px solid var(--color-border);
      transition: var(--transition-fast);
      border-left: 3px solid transparent;
    }
    .part-item:hover, .part-item.is-highlighted {
      background: var(--color-primary-muted);
      border-left-color: var(--color-primary);
    }
    .part-item.is-active {
      background: rgba(245, 166, 35, 0.15);
      border-left-color: var(--color-primary);
    }

    .part-item__callout {
      width: 28px; height: 28px;
      display: flex; align-items: center; justify-content: center;
      background: var(--color-primary);
      color: var(--color-text-inverse);
      font-weight: var(--font-weight-bold);
      font-size: var(--text-body-sm);
      border-radius: var(--radius-full);
      flex-shrink: 0;
    }

    .part-item__info { min-width: 0; }
    .part-item__name {
      font-weight: var(--font-weight-semibold);
      font-size: var(--text-body-sm);
      color: var(--color-text-primary);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .part-item__number {
      font-size: var(--text-caption);
      color: var(--color-text-muted);
      font-family: var(--font-mono, monospace);
    }

    .parts-list__empty {
      padding: var(--space-6);
      text-align: center;
      color: var(--color-text-muted);
      font-size: var(--text-body-sm);
    }

    /* ---- Hotspot detail panel ---- */
    .hotspot-panel {
      position: fixed;
      bottom: 0; left: 260px; right: 280px;
      background: var(--color-bg-elevated);
      border-top: 2px solid var(--color-primary);
      box-shadow: var(--shadow-lg);
      padding: var(--space-4) var(--space-5);
      transform: translateY(100%);
      transition: transform var(--duration-normal) var(--ease-in-out);
      z-index: 50;
    }
    .hotspot-panel.is-open {
      transform: translateY(0);
    }

    .hotspot-panel__close {
      position: absolute; top: var(--space-3); right: var(--space-4);
      background: none; border: none; cursor: pointer;
      font-size: 1.3rem; color: var(--color-text-muted);
      padding: var(--space-1);
    }
    .hotspot-panel__close:hover { color: var(--color-text-primary); }

    .hotspot-detail {
      display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap;
    }

    .hotspot-callout {
      width: 40px; height: 40px;
      display: flex; align-items: center; justify-content: center;
      background: var(--color-primary); color: var(--color-text-inverse);
      font-weight: var(--font-weight-bold); font-size: 1.2rem;
      border-radius: var(--radius-full); flex-shrink: 0;
    }

    .hotspot-name {
      font-family: var(--font-heading);
      font-weight: var(--heading-weight-primary);
      font-size: 1.1rem;
      color: var(--color-text-primary);
      margin: 0;
    }
    .hotspot-partnumber {
      font-size: var(--text-body-sm);
      color: var(--color-text-muted);
      font-family: var(--font-mono, monospace);
    }
    .hotspot-desc {
      font-size: var(--text-body-sm);
      color: var(--color-text-secondary);
      max-width: 400px;
      margin: 0;
    }

    .hotspot-actions {
      display: flex; gap: var(--space-2); margin-left: auto;
    }

    /* ---- Buttons ---- */
    .btn {
      display: inline-flex; align-items: center; gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      border: 1px solid var(--color-border);
      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);
      background: var(--color-bg-elevated);
      color: var(--color-text-primary);
      text-decoration: none;
    }
    .btn-primary {
      background: var(--color-primary);
      color: var(--color-text-inverse);
      border-color: var(--color-primary);
    }
    .btn-primary:hover { opacity: 0.9; }
    .btn-accent {
      background: var(--color-success, #22c55e);
      color: white;
      border-color: var(--color-success, #22c55e);
    }
    .btn-accent:hover { opacity: 0.9; }
    .btn-sm {
      padding: var(--space-1) var(--space-3);
      font-size: var(--text-caption);
    }

    /* =========================================================================
       RESPONSIVE
       ========================================================================= */

    @media (max-width: 900px) {
      .sidebar { width: 56px; overflow: hidden; }
      .sidebar__brand { padding: var(--space-3); justify-content: center; }
      .brand-name { display: none; }
      .nav-section-label { display: none; }
      .nav-item { padding: var(--space-2) var(--space-3); justify-content: center; }
      .nav-item span:not(.nav-item__icon) { display: none; }

      .parts-sidebar { width: 200px; }
      .hotspot-panel { left: 56px; right: 200px; }
    }

    @media (max-width: 640px) {
      .parts-sidebar { display: none; }
      .hotspot-panel { left: 56px; right: 0; }
      .diagram-grid { grid-template-columns: 1fr; }
    }
  </style>
</head>
<body>
  <div class="app-shell">

    <!-- SIDEBAR -->
    <aside class="sidebar themed-scrollbar" id="sidebar" role="navigation" aria-label="Menu principal">
      <div class="sidebar__brand">
        <div class="brand-logo" aria-hidden="true">N</div>
        <div class="brand-name">
          <span class="brand-name__primary">Nexus</span>
          <span class="brand-name__sub">Autoparts POS</span>
        </div>
      </div>
      <nav class="sidebar__nav">
        <div class="nav-section-label">Principal</div>
        <a class="nav-item" href="/pos/dashboard" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
          Dashboard
        </a>
        <a class="nav-item" href="/pos/sale" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><path d="M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 01-8 0"/></svg>
          Punto de Venta
        </a>
        <a class="nav-item" href="/pos/inventory" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><path d="M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"/></svg>
          Inventario
        </a>
        <a class="nav-item" href="/pos/catalog" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M8 7h8M8 12h8M8 17h5"/></svg>
          Catalogo
        </a>
        <a class="nav-item is-active" href="/pos/diagrams" role="menuitem" aria-current="page">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><path d="M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"/></svg>
          Diagramas
        </a>
        <div class="nav-section-label" style="margin-top: var(--space-2);">Gestion</div>
        <a class="nav-item" href="/pos/customers" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg>
          Clientes
        </a>
        <a class="nav-item" href="/pos/invoicing" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14,2 14,8 20,8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
          Facturacion
        </a>
        <a class="nav-item" href="/pos/accounting" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/></svg>
          Contabilidad
        </a>
        <a class="nav-item" href="/pos/reports" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><polyline points="22,12 18,12 15,21 9,3 6,12 2,12"/></svg>
          Reportes
        </a>
        <div class="nav-section-label" style="margin-top: var(--space-2);">Sistema</div>
        <a class="nav-item" href="/pos/config" role="menuitem">
          <svg class="nav-item__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75"><circle cx="12" cy="12" r="3"/><path d="M19.07 4.93l-1.41 1.41M6.34 17.66l-1.41 1.41M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M12 2v2M12 20v2M2 12h2M20 12h2"/></svg>
          Configuracion
        </a>
      </nav>
      <div class="sidebar__profile">
        <div class="profile-avatar" id="profileAvatar" aria-hidden="true">--</div>
        <div class="profile-info">
          <div class="profile-info__name" id="profileName">--</div>
          <div class="profile-info__role" id="profileRole">--</div>
        </div>
      </div>
    </aside>

    <!-- MAIN CONTENT -->
    <main class="main-content">

      <!-- Page header (list view) -->
      <div class="page-header" id="pageHeader">
        <h1 class="page-header__title">Diagramas Explodidos</h1>
        <input type="text" class="page-header__filter" id="diagramFilter" placeholder="Filtrar diagramas..." />
      </div>

      <!-- Loading spinner -->
      <div class="loading" id="loading"><div class="spinner"></div></div>

      <!-- Empty state -->
      <div class="empty-state" id="emptyState">
        <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" style="color:var(--color-text-disabled)">
          <path d="M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"/>
        </svg>
        <div class="empty-state__title">Sin diagramas</div>
        <div class="empty-state__subtitle">No hay diagramas disponibles. Los diagramas se asocian a vehiculos y categorias de partes.</div>
      </div>

      <!-- Diagram list (cards grid) -->
      <div class="page-body" id="diagramList"></div>

      <!-- Diagram viewer (SVG + parts list) -->
      <div class="diagram-viewer" id="diagramViewer">
        <div class="viewer-main">
          <div class="viewer-toolbar">
            <button class="btn-icon" id="backBtn" title="Volver a la lista">
              <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg>
            </button>
            <span class="viewer-toolbar__title" id="diagramTitle"></span>
            <div class="zoom-controls">
              <button class="btn-icon" id="zoomOutBtn" title="Alejar (-)">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>
              </button>
              <button class="btn-icon" id="zoomResetBtn" title="Restablecer zoom (0)">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 4v6h6"/><path d="M3.51 15a9 9 0 102.13-9.36L1 10"/></svg>
              </button>
              <button class="btn-icon" id="zoomInBtn" title="Acercar (+)">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>
              </button>
            </div>
          </div>

          <!-- SVG display area -->
          <div class="svg-container" id="svgContainer">
            <div class="svg-wrapper" id="svgWrapper"></div>
          </div>
        </div>

        <!-- Parts list sidebar -->
        <aside class="parts-sidebar" id="partsList"></aside>
      </div>

      <!-- Hotspot detail panel (slides up from bottom) -->
      <div class="hotspot-panel" id="hotspotPanel">
        <button class="hotspot-panel__close" id="hotspotClose" aria-label="Cerrar">&#10005;</button>
        <div id="hotspotBody"></div>
      </div>

    </main>
  </div>

  <script src="/pos/static/js/i18n.js"></script>
  <script src="/pos/static/js/kiosk.js"></script>
  <script src="/pos/static/js/app-init.js"></script>
  <script src="/pos/static/js/pos-utils.js"></script>
  <script src="/pos/static/js/sidebar.js"></script>
  <script src="/pos/static/js/diagrams.js"></script>
  <script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>
</body>
</html>
