<!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>Flotillas — 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="manifest" href="/pos/static/pwa/manifest.json" />
  <meta name="theme-color" content="#F5A623" />

  <style>
    /* =========================================================================
       BASE RESET & SHELL
       ========================================================================= */

    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html, body {
      height: 100%;
    }

    body {
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
      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);
    }

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

    .page-shell {
      display: flex;
      height: 100vh;
      overflow: hidden;
    }

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

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

    .page-header h1 {
      font-family: var(--font-heading);
      font-size: var(--text-h3);
      font-weight: var(--font-weight-bold);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-text-primary);
      white-space: nowrap;
    }

    .page-header__actions {
      display: flex;
      gap: var(--space-3);
      align-items: center;
    }

    .page-content {
      flex: 1;
      overflow-y: auto;
      padding: var(--space-5) var(--space-6);
      scrollbar-width: thin;
      scrollbar-color: var(--scrollbar-thumb, #444) var(--scrollbar-track, #222);
    }

    /* =========================================================================
       STATS ROW
       ========================================================================= */

    .stats-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: var(--space-4);
      margin-bottom: var(--space-5);
    }

    .stat-card {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      padding: var(--space-4) var(--space-5);
      display: flex;
      flex-direction: column;
      gap: var(--space-1);
    }

    [data-theme="industrial"] .stat-card {
      clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    }

    [data-theme="modern"] .stat-card {
      border-radius: var(--radius-lg);
    }

    .stat-card__label {
      font-size: var(--text-caption);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-widest);
      text-transform: uppercase;
      color: var(--color-text-muted);
    }

    .stat-card__value {
      font-family: var(--font-heading);
      font-size: var(--text-h2);
      font-weight: var(--font-weight-extrabold);
      color: var(--color-text-primary);
    }

    .stat-card__value--warn {
      color: var(--color-warning, #E3B341);
    }

    .stat-card__value--danger {
      color: var(--color-error, #F85149);
    }

    /* =========================================================================
       TABS
       ========================================================================= */

    .tabs {
      display: flex;
      gap: 0;
      border-bottom: 2px solid var(--color-border);
      margin-bottom: var(--space-5);
      flex-shrink: 0;
    }

    .tab-btn {
      padding: var(--space-3) var(--space-5);
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      cursor: pointer;
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--color-text-muted);
      transition: all var(--duration-fast) var(--ease-in-out);
    }

    .tab-btn:hover {
      color: var(--color-text-primary);
    }

    .tab-btn.is-active {
      color: var(--color-primary);
      border-bottom-color: var(--color-primary);
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.is-active {
      display: block;
    }

    /* =========================================================================
       TABLE
       ========================================================================= */

    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: var(--text-body-sm);
    }

    .data-table th {
      text-align: left;
      padding: var(--space-3) var(--space-4);
      font-size: var(--text-caption);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-widest);
      text-transform: uppercase;
      color: var(--color-text-muted);
      border-bottom: 1px solid var(--color-border);
      background: var(--color-surface-2);
      white-space: nowrap;
    }

    .data-table td {
      padding: var(--space-3) var(--space-4);
      border-bottom: 1px solid var(--color-border);
      color: var(--color-text-secondary);
      vertical-align: middle;
    }

    .data-table tr:hover td {
      background: var(--color-surface-2);
    }

    .data-table .mono {
      font-family: var(--font-mono);
      font-size: 0.8125rem;
    }

    /* =========================================================================
       BADGES
       ========================================================================= */

    .badge {
      display: inline-flex;
      align-items: center;
      gap: var(--space-1);
      padding: 2px var(--space-2);
      font-size: var(--text-caption);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-wider);
      text-transform: uppercase;
      border: 1px solid;
    }

    [data-theme="modern"] .badge {
      border-radius: var(--radius-full);
    }

    .badge--active {
      background: rgba(63, 185, 80, 0.15);
      border-color: rgba(63, 185, 80, 0.3);
      color: #3FB950;
    }

    .badge--inactive {
      background: rgba(139, 148, 158, 0.15);
      border-color: rgba(139, 148, 158, 0.3);
      color: #8B949E;
    }

    .badge--overdue {
      background: rgba(248, 81, 73, 0.15);
      border-color: rgba(248, 81, 73, 0.3);
      color: #F85149;
    }

    .badge--upcoming {
      background: rgba(227, 179, 65, 0.15);
      border-color: rgba(227, 179, 65, 0.3);
      color: #E3B341;
    }

    /* =========================================================================
       BUTTONS
       ========================================================================= */

    .btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-wide);
      border: 1px solid var(--color-border);
      cursor: pointer;
      transition: all var(--duration-fast) var(--ease-in-out);
      white-space: nowrap;
      background: var(--color-surface-2);
      color: var(--color-text-primary);
    }

    [data-theme="modern"] .btn {
      border-radius: var(--radius-md);
    }

    .btn--primary {
      background: var(--color-primary);
      color: var(--color-text-inverse, #000);
      border-color: var(--color-primary);
    }

    .btn--primary:hover {
      opacity: 0.85;
    }

    .btn--ghost {
      background: none;
      border-color: transparent;
      color: var(--color-text-secondary);
    }

    .btn--ghost:hover {
      color: var(--color-text-primary);
      background: var(--color-surface-2);
    }

    .btn--sm {
      padding: var(--space-1) var(--space-3);
      font-size: var(--text-caption);
    }

    .btn--danger {
      background: rgba(248, 81, 73, 0.15);
      border-color: rgba(248, 81, 73, 0.3);
      color: #F85149;
    }

    .btn--danger:hover {
      background: rgba(248, 81, 73, 0.25);
    }

    /* =========================================================================
       SEARCH BAR
       ========================================================================= */

    .search-input {
      padding: var(--space-2) var(--space-4);
      border: 1px solid var(--color-border);
      background: var(--color-surface-2);
      color: var(--color-text-primary);
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
      width: 280px;
      transition: border-color var(--duration-fast);
    }

    [data-theme="modern"] .search-input {
      border-radius: var(--radius-md);
    }

    .search-input:focus {
      outline: none;
      border-color: var(--color-primary);
    }

    .search-input::placeholder {
      color: var(--color-text-muted);
    }

    /* =========================================================================
       VEHICLE GRID (alternative view)
       ========================================================================= */

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

    .vehicle-card {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      padding: var(--space-4) var(--space-5);
      cursor: pointer;
      transition: all var(--duration-fast) var(--ease-in-out);
    }

    [data-theme="industrial"] .vehicle-card {
      clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
    }

    [data-theme="modern"] .vehicle-card {
      border-radius: var(--radius-lg);
    }

    .vehicle-card:hover {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 1px var(--color-primary);
    }

    .vehicle-card__header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: var(--space-3);
    }

    .vehicle-card__plate {
      font-family: var(--font-heading);
      font-size: var(--text-h4);
      font-weight: var(--font-weight-extrabold);
      letter-spacing: var(--tracking-wider);
      text-transform: uppercase;
      color: var(--color-primary);
    }

    .vehicle-card__info {
      font-size: var(--text-body-sm);
      color: var(--color-text-secondary);
      line-height: 1.6;
    }

    .vehicle-card__info strong {
      color: var(--color-text-primary);
    }

    .vehicle-card__footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: var(--space-3);
      padding-top: var(--space-3);
      border-top: 1px solid var(--color-border);
      font-size: var(--text-caption);
      color: var(--color-text-muted);
    }

    /* =========================================================================
       MODAL
       ========================================================================= */

    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
      z-index: 500;
      align-items: center;
      justify-content: center;
    }

    .modal-overlay.is-open {
      display: flex;
    }

    .modal {
      background: var(--color-bg-elevated);
      border: 1px solid var(--color-border);
      width: 90%;
      max-width: 560px;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    [data-theme="modern"] .modal {
      border-radius: var(--radius-lg);
    }

    .modal__header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: var(--space-4) var(--space-6);
      border-bottom: 1px solid var(--color-border);
    }

    .modal__title {
      font-family: var(--font-heading);
      font-size: var(--text-h4);
      font-weight: var(--font-weight-bold);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }

    .modal__close {
      background: none;
      border: none;
      color: var(--color-text-muted);
      cursor: pointer;
      font-size: 1.25rem;
      padding: var(--space-1);
    }

    .modal__close:hover {
      color: var(--color-text-primary);
    }

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

    .modal__footer {
      padding: var(--space-4) var(--space-6);
      border-top: 1px solid var(--color-border);
      display: flex;
      justify-content: flex-end;
      gap: var(--space-3);
    }

    /* =========================================================================
       FORM
       ========================================================================= */

    .form-group {
      margin-bottom: var(--space-4);
    }

    .form-group label {
      display: block;
      font-size: var(--text-caption);
      font-weight: var(--font-weight-semibold);
      letter-spacing: var(--tracking-widest);
      text-transform: uppercase;
      color: var(--color-text-muted);
      margin-bottom: var(--space-1);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
      width: 100%;
      padding: var(--space-2) var(--space-3);
      border: 1px solid var(--color-border);
      background: var(--color-surface-2);
      color: var(--color-text-primary);
      font-family: var(--font-body);
      font-size: var(--text-body-sm);
    }

    [data-theme="modern"] .form-group input,
    [data-theme="modern"] .form-group select,
    [data-theme="modern"] .form-group textarea {
      border-radius: var(--radius-md);
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
      outline: none;
      border-color: var(--color-primary);
    }

    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--space-4);
    }

    /* =========================================================================
       ALERT CARD
       ========================================================================= */

    .alert-card {
      background: var(--color-bg-elevated);
      border: 1px solid rgba(248, 81, 73, 0.3);
      border-left: 4px solid #F85149;
      padding: var(--space-4) var(--space-5);
      margin-bottom: var(--space-3);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    [data-theme="modern"] .alert-card {
      border-radius: var(--radius-md);
    }

    .alert-card__info {
      flex: 1;
    }

    .alert-card__vehicle {
      font-weight: var(--font-weight-semibold);
      color: var(--color-text-primary);
      margin-bottom: var(--space-1);
    }

    .alert-card__detail {
      font-size: var(--text-caption);
      color: var(--color-text-muted);
    }

    /* =========================================================================
       PAGINATION
       ========================================================================= */

    .pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--space-2);
      padding: var(--space-4) 0;
    }

    .pagination__btn {
      padding: var(--space-1) var(--space-3);
      border: 1px solid var(--color-border);
      background: var(--color-surface-2);
      color: var(--color-text-secondary);
      cursor: pointer;
      font-size: var(--text-caption);
      font-weight: var(--font-weight-semibold);
    }

    [data-theme="modern"] .pagination__btn {
      border-radius: var(--radius-sm);
    }

    .pagination__btn:hover {
      border-color: var(--color-primary);
      color: var(--color-primary);
    }

    .pagination__btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .pagination__info {
      font-size: var(--text-caption);
      color: var(--color-text-muted);
    }

    /* =========================================================================
       EMPTY STATE
       ========================================================================= */

    .empty-state {
      text-align: center;
      padding: var(--space-8) var(--space-4);
      color: var(--color-text-muted);
    }

    .empty-state__icon {
      font-size: 3rem;
      margin-bottom: var(--space-3);
      opacity: 0.4;
    }

    .empty-state__text {
      font-size: var(--text-body);
      margin-bottom: var(--space-4);
    }

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

    @media (max-width: 768px) {
      .page-header {
        padding: var(--space-3) var(--space-4);
        flex-wrap: wrap;
      }
      .page-content {
        padding: var(--space-4);
      }
      .search-input {
        width: 100%;
      }
      .form-row {
        grid-template-columns: 1fr;
      }
      .vehicle-grid {
        grid-template-columns: 1fr;
      }
      .stats-row {
        grid-template-columns: 1fr 1fr;
      }
    }
  </style>
</head>
<body>

<div class="page-shell">
  <!-- Sidebar injected by sidebar.js -->
  <aside id="sidebar"></aside>

  <div class="main-area pos-main-offset">
    <!-- Offline banner injected by offline-banner.js -->
    <div id="offlineBanner"></div>

    <div class="page-header">
      <h1>Flotillas</h1>
      <div class="page-header__actions">
        <input type="text" class="search-input" id="searchInput"
               placeholder="Buscar placa, marca, modelo..." />
        <button class="btn btn--primary" id="btnNewVehicle">+ Nuevo Vehiculo</button>
      </div>
    </div>

    <div class="page-content">
      <!-- Stats -->
      <div class="stats-row" id="statsRow">
        <div class="stat-card">
          <span class="stat-card__label">Vehiculos Activos</span>
          <span class="stat-card__value" id="statTotal">--</span>
        </div>
        <div class="stat-card">
          <span class="stat-card__label">Mant. Vencidos</span>
          <span class="stat-card__value stat-card__value--danger" id="statOverdue">--</span>
        </div>
        <div class="stat-card">
          <span class="stat-card__label">Prox. Este Mes</span>
          <span class="stat-card__value stat-card__value--warn" id="statUpcoming">--</span>
        </div>
        <div class="stat-card">
          <span class="stat-card__label">Costo Mes</span>
          <span class="stat-card__value" id="statCost">--</span>
        </div>
      </div>

      <!-- Tabs -->
      <div class="tabs">
        <button class="tab-btn is-active" data-tab="vehicles">Vehiculos</button>
        <button class="tab-btn" data-tab="maintenance">Mantenimiento</button>
        <button class="tab-btn" data-tab="history">Historial</button>
        <button class="tab-btn" data-tab="alerts">Alertas</button>
      </div>

      <!-- Tab: Vehicles -->
      <div class="tab-panel is-active" id="tab-vehicles">
        <div class="vehicle-grid" id="vehicleGrid">
          <div class="empty-state">
            <div class="empty-state__icon">&#x1F69A;</div>
            <div class="empty-state__text">Cargando vehiculos...</div>
          </div>
        </div>
        <div class="pagination" id="vehiclePagination"></div>
      </div>

      <!-- Tab: Maintenance -->
      <div class="tab-panel" id="tab-maintenance">
        <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-4);">
          <h2 style="font-family:var(--font-heading);font-size:var(--text-h4);font-weight:var(--font-weight-bold);letter-spacing:var(--tracking-wide);text-transform:uppercase;">Programas de Mantenimiento</h2>
        </div>
        <table class="data-table" id="maintTable">
          <thead>
            <tr>
              <th>Vehiculo</th>
              <th>Tipo</th>
              <th>Intervalo</th>
              <th>Ultimo</th>
              <th>Proximo</th>
              <th>Estado</th>
              <th></th>
            </tr>
          </thead>
          <tbody id="maintBody">
            <tr><td colspan="7" style="text-align:center;padding:var(--space-6);color:var(--color-text-muted);">Cargando...</td></tr>
          </tbody>
        </table>
      </div>

      <!-- Tab: History -->
      <div class="tab-panel" id="tab-history">
        <table class="data-table">
          <thead>
            <tr>
              <th>Fecha</th>
              <th>Vehiculo</th>
              <th>Tipo</th>
              <th>Km</th>
              <th>Costo</th>
              <th>Empleado</th>
              <th>Notas</th>
            </tr>
          </thead>
          <tbody id="historyBody">
            <tr><td colspan="7" style="text-align:center;padding:var(--space-6);color:var(--color-text-muted);">Cargando...</td></tr>
          </tbody>
        </table>
      </div>

      <!-- Tab: Alerts -->
      <div class="tab-panel" id="tab-alerts">
        <div id="alertsList">
          <div class="empty-state">
            <div class="empty-state__text">Cargando alertas...</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Modal: New/Edit Vehicle -->
<div class="modal-overlay" id="vehicleModal">
  <div class="modal">
    <div class="modal__header">
      <span class="modal__title" id="vehicleModalTitle">Nuevo Vehiculo</span>
      <button class="modal__close" onclick="Fleet.closeVehicleModal()">&times;</button>
    </div>
    <div class="modal__body">
      <input type="hidden" id="vehEditId" />
      <div class="form-row">
        <div class="form-group">
          <label>Placa</label>
          <input type="text" id="vehPlate" placeholder="ABC-123" maxlength="20" />
        </div>
        <div class="form-group">
          <label>VIN</label>
          <input type="text" id="vehVin" placeholder="17 caracteres" maxlength="17" />
        </div>
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Marca</label>
          <input type="text" id="vehMake" placeholder="Toyota" />
        </div>
        <div class="form-group">
          <label>Modelo</label>
          <input type="text" id="vehModel" placeholder="Hilux" />
        </div>
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Anio</label>
          <input type="number" id="vehYear" placeholder="2024" min="1900" max="2100" />
        </div>
        <div class="form-group">
          <label>Kilometraje</label>
          <input type="number" id="vehMileage" placeholder="0" min="0" />
        </div>
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Combustible</label>
          <select id="vehFuel">
            <option value="gasolina">Gasolina</option>
            <option value="diesel">Diesel</option>
            <option value="gas">Gas LP</option>
            <option value="electrico">Electrico</option>
            <option value="hibrido">Hibrido</option>
          </select>
        </div>
        <div class="form-group">
          <label>Color</label>
          <input type="text" id="vehColor" placeholder="Blanco" />
        </div>
      </div>
      <div class="form-group">
        <label>Propietario</label>
        <input type="text" id="vehOwner" placeholder="Nombre del propietario" />
      </div>
      <div class="form-group">
        <label>Notas</label>
        <textarea id="vehNotes" rows="2" placeholder="Notas adicionales..."></textarea>
      </div>
    </div>
    <div class="modal__footer">
      <button class="btn btn--ghost" onclick="Fleet.closeVehicleModal()">Cancelar</button>
      <button class="btn btn--primary" id="btnSaveVehicle" onclick="Fleet.saveVehicle()">Guardar</button>
    </div>
  </div>
</div>

<!-- Modal: New Schedule -->
<div class="modal-overlay" id="scheduleModal">
  <div class="modal">
    <div class="modal__header">
      <span class="modal__title">Nuevo Programa de Mantenimiento</span>
      <button class="modal__close" onclick="Fleet.closeScheduleModal()">&times;</button>
    </div>
    <div class="modal__body">
      <input type="hidden" id="schedVehicleId" />
      <div class="form-group">
        <label>Vehiculo</label>
        <select id="schedVehicleSelect"></select>
      </div>
      <div class="form-group">
        <label>Tipo de Mantenimiento</label>
        <input type="text" id="schedType" placeholder="Cambio de aceite, Frenos, etc." />
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Intervalo (km)</label>
          <input type="number" id="schedIntervalKm" placeholder="10000" min="0" />
        </div>
        <div class="form-group">
          <label>Intervalo (meses)</label>
          <input type="number" id="schedIntervalMonths" placeholder="6" min="0" />
        </div>
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Proximo Vencimiento (fecha)</label>
          <input type="date" id="schedNextDate" />
        </div>
        <div class="form-group">
          <label>Proximo Vencimiento (km)</label>
          <input type="number" id="schedNextKm" placeholder="50000" min="0" />
        </div>
      </div>
      <div class="form-group">
        <label>Notas</label>
        <textarea id="schedNotes" rows="2" placeholder="Notas..."></textarea>
      </div>
    </div>
    <div class="modal__footer">
      <button class="btn btn--ghost" onclick="Fleet.closeScheduleModal()">Cancelar</button>
      <button class="btn btn--primary" onclick="Fleet.saveSchedule()">Guardar</button>
    </div>
  </div>
</div>

<!-- Modal: Record Maintenance -->
<div class="modal-overlay" id="logModal">
  <div class="modal">
    <div class="modal__header">
      <span class="modal__title">Registrar Mantenimiento</span>
      <button class="modal__close" onclick="Fleet.closeLogModal()">&times;</button>
    </div>
    <div class="modal__body">
      <div class="form-group">
        <label>Vehiculo</label>
        <select id="logVehicleSelect"></select>
      </div>
      <div class="form-group">
        <label>Programa (opcional)</label>
        <select id="logScheduleSelect">
          <option value="">-- Sin programa --</option>
        </select>
      </div>
      <div class="form-group">
        <label>Tipo de Mantenimiento</label>
        <input type="text" id="logType" placeholder="Cambio de aceite" />
      </div>
      <div class="form-row">
        <div class="form-group">
          <label>Kilometraje Actual</label>
          <input type="number" id="logMileage" placeholder="50000" min="0" />
        </div>
        <div class="form-group">
          <label>Costo</label>
          <input type="number" id="logCost" placeholder="0.00" min="0" step="0.01" />
        </div>
      </div>
      <div class="form-group">
        <label>Refacciones Usadas</label>
        <textarea id="logParts" rows="2" placeholder="Filtro de aceite, aceite 5W-30..."></textarea>
      </div>
      <div class="form-group">
        <label>Notas</label>
        <textarea id="logNotes" rows="2" placeholder="Notas..."></textarea>
      </div>
    </div>
    <div class="modal__footer">
      <button class="btn btn--ghost" onclick="Fleet.closeLogModal()">Cancelar</button>
      <button class="btn btn--primary" onclick="Fleet.saveLog()">Registrar</button>
    </div>
  </div>
</div>

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

</body>
</html>
