/* style.css - Estilos para Aleph POS (Minimalista) */

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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
header {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

header .subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.btn-logout {
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.btn-logout:hover {
    background: var(--gray-200);
}

/* Navegación */
.nav-links {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow);
}

.btn-nav {
    background: transparent;
    color: var(--gray-500);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-nav:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-nav.active {
    background: var(--primary);
    color: var(--white);
}

/* Filtros */
.filters {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.filters form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--white);
    transition: border-color 0.15s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Botones */
button[type="submit"],
.btn-upload,
.btn-nav {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

button[type="submit"]:hover,
.btn-upload:hover {
    background: var(--primary-hover);
}

.btn-clear {
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-clear:hover {
    background: var(--gray-200);
}

/* Tabla */
.table-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: var(--gray-50);
}

tr.stock-low {
    background: #fef3c7;
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8) {
    text-align: right;
}

.no-results {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 24px;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-page {
    background: var(--white);
    color: var(--primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--gray-300);
    transition: all 0.15s;
}

.btn-page:hover {
    background: var(--gray-50);
    border-color: var(--primary);
}

.page-info {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 16px;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--gray-100);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 16px;
}

.login-box {
    background: var(--white);
    padding: 32px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.login-box header {
    text-align: center;
    margin-bottom: 24px;
    background: none;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.login-box header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-box header p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.btn-login {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-login:hover {
    background: var(--primary-hover);
}

/* Alertas */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
}

/* User Info */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.btn-logout {
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.btn-logout:hover {
    background: var(--gray-200);
}

/* Navegación */
.nav-links {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow);
}

.btn-nav {
    background: transparent;
    color: var(--gray-500);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-nav:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-nav.active {
    background: var(--primary);
    color: var(--white);
}

/* Formulario de carga */
.upload-container {
    background: var(--white);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-form input[type="file"] {
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
}

.btn-upload {
    background: var(--success);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-upload:hover {
    background: #15803d;
}

.help-text {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Info Box */
.info-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-box h3 {
    color: var(--gray-900);
    margin-bottom: 8px;
    font-size: 1rem;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 4px;
    font-size: 0.875rem;
}

/* Secciones */
.section-box {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
}

.section-box h2 {
    color: var(--gray-900);
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Resumen Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.summary-item {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.summary-item h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-item p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* Botón de peligro */
.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Total row */
.total-row {
    background: var(--gray-50);
    font-weight: 600;
}

/* Tipos de movimiento */
.tipo-salida {
    background: #fef3c7;
}

.tipo-entrada {
    background: #dcfce7;
}

.tipo-ajuste {
    background: #dbeafe;
}

/* Alertas */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
}

/* Responsive */
@media (max-width: 768px) {
    .filters form {
        flex-direction: column;
    }
    
    .filter-group input,
    .filter-group select {
        min-width: 100%;
    }
    
    header h1 {
        font-size: 1.125rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
