feat: Add initial setup page and functionality for admin account creation

- Created setup.html for the initial configuration of the admin account.
- Implemented setup.js to handle form submission and validation.
- Added logo images for branding.
- Introduced storage.js for API data handling (load, save, remove).
- Added styles.css for consistent styling across the application.
This commit is contained in:
Marco Gallegos
2025-08-25 08:01:30 -06:00
parent 9c497bc414
commit 4a841917f8
29 changed files with 4163 additions and 3216 deletions

687
styles.css Normal file
View File

@@ -0,0 +1,687 @@
/* --- Estilos Minimalistas y Elegantes --- */
/* Paleta de colores:
- Fondo: #f8f9fa (gris muy claro)
- Texto principal: #212529 (casi negro)
- Bordes/Divisores: #dee2e6 (gris claro)
- Primario: #007bff (azul)
- Secundario: #6c757d (gris medio)
*/
/* Estilos generales y tipografías */
body {
font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
background-color: #f8f9fa;
color: #212529;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.container {
max-width: 800px;
margin: 30px auto;
padding: 25px 30px;
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
h1, h2, h3 {
font-family: 'Montserrat', sans-serif;
font-weight: 600;
color: #212529;
}
h2 {
font-size: 22px;
border-bottom: 1px solid #dee2e6;
padding-bottom: 12px;
margin-top: 0;
margin-bottom: 25px;
}
h3 {
font-size: 18px;
}
.section {
margin-bottom: 40px;
}
/* Formularios */
.form-grid {
display: grid;
grid-template-columns: 160px 1fr;
gap: 18px;
align-items: center;
}
label {
font-weight: 600;
text-align: right;
color: #495057;
font-size: 14px;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
width: 100%;
padding: 10px 12px;
border: 1px solid #ced4da;
border-radius: 5px;
box-sizing: border-box;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
font-family: 'Open Sans', sans-serif;
font-size: 15px;
}
input:focus, select:focus, textarea:focus {
border-color: #80bdff;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
input:disabled {
background-color: #e9ecef;
cursor: not-allowed;
}
button {
background-color: #343a40;
color: white;
padding: 10px 18px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
margin-right: 10px;
transition: background-color 0.2s;
}
button:hover {
background-color: #212529;
}
.btn-secondary, button[type="reset"], button#btnTestTicket, #btnExport {
background-color: #6c757d;
}
.btn-secondary:hover, button[type="reset"]:hover, button#btnTestTicket:hover, #btnExport:hover {
background-color: #5a6268;
}
.btn-danger {
background-color: #dc3545;
}
.btn-danger:hover {
background-color: #c82333;
}
.btn-icon {
padding: 8px;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
}
.btn-icon .material-icons-outlined {
font-size: 20px;
}
.form-actions {
grid-column-start: 2;
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
.form-actions button {
margin-right: 0;
margin-left: 10px;
}
/* Tabla */
.table-wrapper {
overflow-x: auto;
border: 1px solid #dee2e6;
border-radius: 5px;
}
#tblMoves, #tblClients, #tblUsers {
width: 100%;
border-collapse: collapse;
margin: 0;
}
#tblMoves th, #tblMoves td,
#tblClients th, #tblClients td,
#tblUsers th, #tblUsers td {
border-bottom: 1px solid #dee2e6;
padding: 12px 15px;
text-align: left;
white-space: nowrap;
}
#tblMoves td:last-child, #tblMoves th:last-child,
#tblClients td:last-child, #tblClients th:last-child,
#tblUsers td:last-child, #tblUsers th:last-child {
text-align: center;
}
#tblMoves th, #tblClients th, #tblUsers th {
background-color: #f8f9fa;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
border-bottom-width: 2px;
}
#tblMoves tbody tr:last-child td,
#tblClients tbody tr:last-child td,
#tblUsers tbody tr:last-child td {
border-bottom: none;
}
.action-btn {
background: none;
border: none;
color: #007bff;
cursor: pointer;
padding: 5px;
font-size: 13px;
text-decoration: none;
}
.action-btn:hover {
text-decoration: underline;
}
button.action-btn {
color: #dc3545;
}
/* Estilos del Ticket */
.ticket {
width: 58mm;
max-width: 58mm;
background: #fff;
color: #000;
padding: 10px;
box-sizing: border-box;
font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
border: 1px solid #ccc; /* Visible en pantalla, no en impresión */
}
.t-logo {
display: block;
margin: 0 auto 8px auto;
max-width: 75%;
height: auto;
}
.t-center { text-align: center; }
.t-bold { font-weight: bold; }
.t-tagline { font-size: 11px; margin-bottom: 6px; }
.t-small { font-size: 10px; }
.t-divider { border-top: 1px dashed #000; margin: 8px 0; }
.t-row { display: flex; justify-content: space-between; }
.t-footer { margin-top: 10px; }
.t-qr-section {
margin-top: 10px;
padding-top: 10px;
border-top: 1px dashed #000;
text-align: center;
}
#qr-canvas {
margin: 5px auto;
display: block;
}
/***** MODO IMPRESIÓN *****/
@media print {
body {
background: #fff;
color: #000;
margin: 0;
}
.no-print, .container, .main-footer-credits {
display: none !important;
}
#printArea {
display: block !important;
}
@page {
size: 58mm auto;
margin: 1cm 0;
}
.ticket {
border: none;
width: 100%;
max-width: 100%;
padding: 0;
}
}
/* --- Estilos de Pestañas --- */
.main-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25px;
border-bottom: 1px solid #dee2e6;
}
.header-logo {
max-width: 20%;
height: auto;
padding-right: 50px;
}
.tabs {
display: flex;
flex-grow: 1;
}
.tab-link {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
cursor: pointer;
background: none;
border: none;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
font-size: 16px;
color: #6c757d;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color 0.2s, border-color 0.2s;
}
.tab-link:hover {
color: #343a40;
}
.tab-link.active {
color: #343a40;
border-bottom-color: #343a40;
}
.tab-link.active span:not(.material-icons-outlined) {
display: inline-block;
}
.tab-link:not(.active) span:not(.material-icons-outlined) {
display: none;
}
.tab-link:not(.active) {
color: rgba(108, 117, 125, 0.5);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Table Styles */
table {
width: 100%;
border-collapse: collapse;
margin: 0;
}
table th, table td {
border-bottom: 1px solid #dee2e6;
padding: 12px 15px;
text-align: left;
white-space: nowrap;
}
table th {
background-color: #000;
color: #fff;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
border-bottom-width: 2px;
}
table tbody tr:nth-child(even) {
background-color: #f8f9fa;
}
table tbody tr:hover {
background-color: #e9ecef;
}
.section-divider {
border: 0;
border-top: 1px solid #dee2e6;
margin: 40px 0;
}
/* Dashboard Styles */
.dashboard-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}
.stat-card {
background-color: #fff;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
text-align: center;
}
.stat-card h3 {
margin: 0 0 0.5rem 0;
font-size: 1rem;
color: #555;
font-weight: 500;
}
.stat-card p {
margin: 0;
font-size: 2rem;
font-weight: 600;
color: #343a40;
}
.dashboard-chart {
background-color: #fff;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
position: relative;
height: 300px;
}
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}
.appointments-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.appointment-item {
background-color: #fff;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
display: flex;
justify-content: space-between;
align-items: center;
}
.appointment-item a {
text-decoration: none;
color: #343a40;
font-weight: 600;
}
.appointment-item a:hover {
color: #0056b3;
}
.appointment-item .date {
color: #6c757d;
font-size: 14px;
}
/* --- Estilos específicos de Clientes --- */
.form-grid-single {
display: grid;
grid-template-columns: 1fr;
gap: 12px;
}
.form-grid-single label {
text-align: left;
margin-bottom: -5px; /* Acercar la etiqueta al campo */
}
.form-grid-single input[type="tel"] {
max-width: 250px;
}
.form-grid-single .checkbox-container {
margin-top: 10px;
}
.form-grid-single .checkbox-container label {
font-weight: 400; /* Peso normal para checkboxes */
}
.form-actions-single {
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
.checkbox-container {
display: flex;
align-items: center;
}
.checkbox-container input[type="checkbox"] {
width: auto;
margin-right: 8px;
}
.hidden {
display: none !important;
}
#m-subtipo-container {
/* Esto asegura que el contenedor del subtipo se alinee correctamente en el grid */
grid-column: 1 / -1;
display: grid;
grid-template-columns: 160px 1fr;
gap: 18px;
align-items: center;
}
.client-history-row td {
padding: 0 !important;
background-color: #f8f9fa;
}
.client-history-content {
padding: 15px;
}
.client-history-content h4 {
margin-top: 0;
font-family: 'Montserrat', sans-serif;
}
.client-history-content table {
width: 100%;
border-collapse: collapse;
}
.client-history-content th, .client-history-content td {
padding: 8px;
border-bottom: 1px solid #dee2e6;
font-size: 14px;
}
.client-history-content th {
text-align: left;
font-weight: 600;
}
/* --- Estilos de Configuración --- */
.data-location-info {
background-color: #e9ecef;
padding: 15px;
border-radius: 5px;
font-size: 14px;
line-height: 1.5;
}
.data-location-info strong {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.sub-section {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #e9ecef;
}
.sub-section h3 {
margin-top: 0;
}
/* --- Estilos del Pie de Página --- */
.main-footer-credits {
text-align: center;
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #dee2e6;
color: #6c757d;
font-size: 12px;
}
.main-footer-credits p {
margin: 0 0 5px 0;
}
/* --- Estilos para Sub-Pestañas --- */
.sub-tabs {
display: flex;
border-bottom: 1px solid #dee2e6;
margin-bottom: 25px;
}
.sub-tab-link {
padding: 10px 20px;
cursor: pointer;
background: none;
border: none;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
font-size: 16px;
color: #6c757d;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color 0.2s, border-color 0.2s;
}
.sub-tab-link:hover {
color: #343a40;
}
.sub-tab-link.active {
color: #343a40;
border-bottom-color: #343a40;
}
.sub-tab-content {
display: none;
}
.sub-tab-content.active {
display: block;
}
.client-history-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.client-history-header h4 {
margin: 0;
}
#btn-export-history {
background-color: #17a2b8;
}
#btn-export-history:hover {
background-color: #138496;
}
/* --- Nuevos estilos para consulta de clientes --- */
.consult-grid {
display: grid;
grid-template-columns: 300px 1fr;
gap: 30px;
}
.client-list-container h2, .client-record-container h2 {
font-size: 20px;
}
.client-list-container .table-wrapper {
max-height: 400px;
overflow-y: auto;
}
#tblClients tbody tr {
cursor: pointer;
}
#tblClients tbody tr:hover {
background-color: #f1f3f5;
}
#tblClients tbody tr.selected {
background-color: #e9ecef;
}
.client-record-container {
border-left: 1px solid #dee2e6;
padding-left: 30px;
}
#client-record-placeholder {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: #6c757d;
text-align: center;
}
#client-details p {
margin: 0 0 10px 0;
}
#client-details strong {
display: inline-block;
width: 100px;
}
.main-footer {
text-align: center;
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #dee2e6;
color: #6c757d;
font-size: 12px;
}
.footer-logos {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
margin-bottom: 10px;
}
.footer-logos img {
height: 40px; /* Reducido para mejor proporción */
width: auto; /* Añadido para mantener la proporción */
max-height: 40px; /* Añadido para evitar distorsión */
}
.footer-info p {
margin: 5px 0;
}