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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 15px;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card h2 {
    color: #1e3c72;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

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

label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.select-with-search {
    position: relative;
}

.select-with-search select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-with-search select:focus {
    outline: none;
    border-color: #1e3c72;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 8px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1e3c72;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 15px;
}

.toggle-option {
    flex: 1;
}

.toggle-option input[type="radio"] {
    display: none;
}

.toggle-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: #f5f5f5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin-bottom: 0;
}

.toggle-option .icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.toggle-option .text {
    font-weight: 600;
    color: #555;
    font-size: 15px;
}

.toggle-option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-color: #1e3c72;
}

.toggle-option input[type="radio"]:checked + label .text {
    color: white;
}

.toggle-option label:hover {
    background: #e8e8e8;
}

.toggle-option input[type="radio"]:checked + label:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.success-message h3 {
    color: #4CAF50;
    font-size: 22px;
    margin-bottom: 10px;
}

.success-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 30px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message h3 {
    color: #f44336;
    font-size: 22px;
    margin-bottom: 10px;
}

.error-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Movimientos List */
.movimientos-list {
    max-height: 400px;
    overflow-y: auto;
}

.movimiento-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid #1e3c72;
    transition: transform 0.2s ease;
}

.movimiento-item.entrada {
    border-left-color: #4CAF50;
}

.movimiento-item.salida {
    border-left-color: #f44336;
}

.movimiento-item:hover {
    transform: translateX(5px);
}

.movimiento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.movimiento-producto {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.movimiento-tipo {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.movimiento-tipo.entrada {
    background: #e8f5e9;
    color: #4CAF50;
}

.movimiento-tipo.salida {
    background: #ffebee;
    color: #f44336;
}

.movimiento-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.movimiento-cantidad {
    font-weight: 600;
    color: #1e3c72;
    font-size: 16px;
}

.movimiento-fecha {
    color: #999;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 15px;
}

/* Scrollbar personalizado */
.movimientos-list::-webkit-scrollbar {
    width: 8px;
}

.movimientos-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.movimientos-list::-webkit-scrollbar-thumb {
    background: #1e3c72;
    border-radius: 10px;
}

.movimientos-list::-webkit-scrollbar-thumb:hover {
    background: #2a5298;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movimiento-item {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 26px;
    }
    
    .card {
        padding: 20px;
    }
    
    .toggle-group {
        flex-direction: column;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}
